Git Merge Conflict (UU): How do I resolve conflict without adding file to next commit?

后端 未结 1 468
天涯浪人
天涯浪人 2021-01-12 17:22

How do I resolve a UU (merge conflict) without adding that file to the next commit.

For example, I just cherry picked a commit to another branch and there were merge

相关标签:
1条回答
  • 2021-01-12 18:11

    I don't know what version of git you were using back in '11, but right now I'm on 1.7.7.4.

    It appears to me that doing an add to mark the conflict resolved does add the file to the stage; so my approach is:

    git add <filename>
    git reset HEAD <filename>
    

    You could also create a custom git command that does this for you. I created an executable file named git-resolve (no extension) in a directory on my path (I like to put stuff like this in ~/.bin) and put this in it:

    git add $@
    git reset HEAD $@
    

    Then from the command line, after I've resolved my conflicts, I can do:

    $ git resolve <filename>
    
    0 讨论(0)
提交回复
热议问题