How do I shallow clone a repo on a specific branch? How do I shallow clone a repo on a specific branch? git git

How do I shallow clone a repo on a specific branch?


To clone repo foo.git with branch bar do:

git clone --depth 1 https://path/to/repo/foo.git -b bar

See the git-clone documentation: https://www.kernel.org/pub/software/scm/git/docs/git-clone.html