Which branch I have when cloning a git repository?
This question already has an answer here:
By default, following the clone operation, you will be on the branch that has been marked as the default branch within the git configuration. Assuming for instance you are using GitHub this is configurable through the Settings page:
Once you have cloned the repository, you can then do git checkout <branchname>
to move into the branch that you are interested in.
Alternatively, you can change the default branch, if that makes sense for you, and your team.
You can clone a specific branch by adding the parameter --single-branch
and the branch name by -b <branch name>
A clone command to clone the branch develop to the current working directory would look like this:
git clone -b develop --single-branch git://my.repository.url
Source: Documentation of git clone
链接地址: http://www.djcxy.com/p/90442.html上一篇: 我可以使用有限分支集创建GIT分支吗?
下一篇: 克隆git存储库时我拥有哪个分支?