The Git repository at the following path is in the detached HEAD state

Foreword:

      An error is reported when using git:

The Git repository at the following path is in the detached HEAD state:
You can look around, make experimental changes and commit them, but be sure to checkout a branch not to lose your work. Otherwise you risk losing your changes

analyse problem:

      It is because the current branch is not clear, that is, the switch branch actually failed. It may be that the name you entered is wrong

Solution:

    Re-enter the switch branch command

Guess you like

Origin blog.csdn.net/weixin_44727080/article/details/113129053