How do I clone a single branch in Git?

后端 未结 21 3001
再見小時候
再見小時候 2020-11-22 00:09

I have a local Git repository called \'skeleton\' that I use for storing project skeletons. It has a few branches, for different kinds of projects:

casey@aga         


        
21条回答
  •  半阙折子戏
    2020-11-22 00:48

    From git-clone man page:

    --single-branch is your friend during clone remember to use with --branch or only remote primary HEAD will be cloned (master by default)

    Always remember to do Ctrl + F5 to read fresh source, not the one from cache :-) (I didn't so didn't know about this option for long time.)

提交回复
热议问题