Why can I not switch branches?

后端 未结 7 1100
故里飘歌
故里飘歌 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:02

    Try this if you don't want any of the merges listed in git status:

    git reset --merge
    

    This resets the index and updates the files in the working tree that are different between and HEAD, but keeps those which are different between the index and working tree (i.e. which have changes which have not been added).

    If a file that is different between and the index has unstaged changes -- reset is aborted.

    More about this - https://www.techpurohit.com/list-some-useful-git-commands & Doc link - https://git-scm.com/docs/git-reset

提交回复
热议问题