Why can I not switch branches?

后端 未结 7 1073
故里飘歌
故里飘歌 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 end up with both modified in the output of git status if there were conflicts produced by a merge. git isn't letting you change branch until you've resolved these conflicts. If you edit that file, you should see some conflict markers in it - there's a guide to resolving those conflicts in the git manual. (Since kernel.org is currently down, you can find that guide here instead.)

    Alternatively, if you think the merge was a mistake, you could undo it with: git reset --merge

提交回复
热议问题