Why did my Git repo enter a detached HEAD state?

后端 未结 9 2813
渐次进展
渐次进展 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 05:01

    try

    git reflog 
    

    this gives you a history of how your HEAD and branch pointers where moved in the past.

    e.g. :

    88ea06b HEAD@{0}: checkout: moving from DEVELOPMENT to remotes/origin/SomeNiceFeature e47bf80 HEAD@{1}: pull origin DEVELOPMENT: Fast-forward

    the top of this list is one reasone one might encounter a DETACHED HEAD state ... checking out a remote tracking branch.

提交回复
热议问题