3

To save disk space, I generally shallow clone:

How do I increase increase the depth of a shallow clone?

Note: I don't want to increase to a full clone, I want to deepen only what I already have.

Tom Hale
  • 40,825
  • 36
  • 187
  • 242

2 Answers2

4

Use git fetch --deepen=<depth>:

man git-fetch says:

  --deepen=<depth>
       Similar to --depth, except it specifies the number of commits from
       the current shallow boundary instead of from the tip of each remote
       branch history.
Tom Hale
  • 40,825
  • 36
  • 187
  • 242
0

To avoid fetching other branches, just specify the remote and branch:

git fetch <remote_name> <branch_name> --deepen=<depth>

The command will fetch and add <depth> additional commits to the shallow clone.

Raine Revere
  • 30,985
  • 5
  • 40
  • 52