After fixing conflicts git still complains?

后端 未结 5 1513
半阙折子戏
半阙折子戏 2021-02-01 02:43

I usually rebase when I pull in changes from my teammates, and often time I have conflicts:

...
CONFLICT (content): Merge conflict in app/views/sear         


        
5条回答
  •  时光说笑
    2021-02-01 03:25

    So after opening each file with a conflict, fixing it then committing the fixed files...

    The problem is that you aren't supposed to commit the fixes. If a.txt has a merge conflict, then your shell log should look like:

    $ vim a.txt # fix conflict
    $ git add a.txt
    $ # no commit between add and rebase!
    $ git rebase --continue
    

    Calling git rebase --continue will take care of the commit itself.

    I'm not sure how to "get back" to before your commit, when you're in the middle of a rebase. git reset --hard HEAD would probably do the trick, but personally I'd feel safer just going straight to git rebase --abort and starting over without committing in the middle.

提交回复
热议问题