当我克隆一个存储库时,出于某种原因,它会自动转到Test_Branch。
$ git branch -a
* Test_Branch
remotes/origin/Test_Branch
remotes/origin/HEAD -> Test_Branch
remotes/origin/develop
remotes/origin/master
我想这是因为"remotes/origin/HEAD“指向Test_Branch。
我的问题是,如何设置“远程/源/头”,以便在克隆时自动转到开发,而不是Test_Branch?
发布于 2014-10-21 08:55:09
要在克隆开发时设置默认分支,请使用
git symbolic-ref HEAD refs/heads/develop
要克隆存储库并签出特定分支,请使用-b branchname
标志,例如
git clone repo.git -b develop
资料来源:https://www.kernel.org/pub/software/scm/git/docs/git-symbolic-ref.html https://www.kernel.org/pub/software/scm/git/docs/git-clone.html
https://stackoverflow.com/questions/26477227
复制相似问题