Why can I not switch branches?

后端 未结 7 1056
故里飘歌
故里飘歌 2020-12-13 23:29

I\'m trying to switch branches in git but I\'m getting this error message:

error: you need to resolve your current index first

I\'m using g

7条回答
  •  一生所求
    2020-12-14 00:13

    you can reset your branch with HEAD

    git reset --hard branch_name
    

    then fetch branches and delete branches which are not on remote from local,

    git fetch -p 
    

提交回复
热议问题