How do I clone a single branch in Git?

后端 未结 21 2570
再見小時候
再見小時候 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:55

    you can use this command to git single branch and rename the folder if you want to keep branched stand alone

    git clone -b [branch-name] --single-branch [url]  [folder_name]
    

    example

    git clone -b mybranch --single-branch git://github/repository.git  project_mybranch
    

提交回复
热议问题