How do I clone a single branch in Git?

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

    git clone --branch {branch-name} {repo-URI}
    

    Example:

    git clone --branch dev https://github.com/ann/cleaningmachine.git
    
    • dev: This is the {branch-name}
    • https://github.com/ann/cleaningmachine.git: This is the {repo-URI}

提交回复
热议问题