GIT:远程分支无法结账

时间:2016-02-11 09:54:32

标签: git github

我在git中遇到了问题。 我试过可能解决方案,但徒劳无功地找到正在发生的事情。我的问题是

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/RC-1.0.0
  remotes/origin/master

我正在尝试签出一个远程分支,即RC-1.0.0:

$ git checkout RC-1.0.0
Note: checking out 'RC-1.0.0'.

You are in 'detached HEAD' state.   
You can look around, make experimental changes and commit them, 
and you can discard any commits you make in this state without impacting 
any branches by performing another checkout. 

If you want to create a new
branch to retain commits you create, you may do so (now or later) by 
using -b with the checkout command again. 
Example:

git checkout -b new_branch_name

任何帮助表示赞赏

1 个答案:

答案 0 :(得分:0)

这不是问题。

阅读此答案以了解其含义: How to move HEAD back to a previous location? (Detached head)

如何解决?

发生这一切的所有细节都在上述问题中 你需要做的是:

# create a new branch starting from this tag
git checkout -b <branch name>

有什么问题?

当您签出分支/标记等时,您无法直接处理它,您必须创建分支才能从此时开始提交和更改。

enter image description here