Why did my Git repo enter a detached HEAD state?

后端 未结 9 2658
渐次进展
渐次进展 2020-11-21 04:36

I ended up with a detached head today, the same problem as described in: git push says everything up-to-date even though I have local changes

As far as I know I didn

9条回答
  •  暖寄归人
    2020-11-21 04:57

    It can happen if you have a tag named same as a branch.

    Example: if "release/0.1" is tag name, then

    git checkout release/0.1
    

    produces detached HEAD at "release/0.1". If you expect release/0.1 to be a branch name, then you get confused.

提交回复
热议问题