How do I clone a specific Git branch? [duplicate]
问题 This question already has an answer here: How do I clone a single branch in Git? 15 answers Git clone will behave copying remote current working branch into local. Is there any way to clone a specific branch by myself without switching branches on the remote repository? 回答1: git clone --single-branch --branch <branchname> <remote-repo> The --single-branch option is valid from version 1.7.10 and later. Please see also the other answer which many people prefer. You may also want to make sure