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

后端 未结 1 1867
甜味超标
甜味超标 2020-12-13 05:24

How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch?

I know how to do a shallow clone:

         


        
相关标签:
1条回答
  • 2020-12-13 06:02

    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

    0 讨论(0)
提交回复
热议问题