8

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 issues. I solved the merge issue and want UU readme.txt changed to M readme.txt but it not be added to the next commit I make.

Thanks

KRB
  • 4,875
  • 17
  • 42
  • 54

1 Answers1

13

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>
Adam Tuttle
  • 19,505
  • 17
  • 80
  • 113
  • I got `git: 'resolve' is not a git command. See 'git --help'`. I am using git 2.2.1 – Anthony Kong Mar 18 '15 at 05:43
  • 4
    Read my answer again carefully. You need to add an executable script somewhere on your path named `git-resolve` for that to work (or just run the two steps manually) – Adam Tuttle Mar 18 '15 at 10:18