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

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.

  • git rebase from a url/path
  • Git RPC Failed; result=22, HTTP code = 400
  • Cloning code from OpenShift
  • git pull ignore one file on local directory
  • git: patch does not apply
  • Syncing git repositories across computers
  • Thanks

  • Why isn't my .npmignore overriding .gitignore on npm publish?
  • How to un-commit the last n commits?
  • Git flow for multiple different variants of the same project
  • git repositories
  • git special characters on mac
  • git + mountain lion + dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
  • One Solution collect form web for “Git Merge Conflict (UU): How do I resolve conflict without adding file to next commit?”

    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>
    
    Git Baby is a git and github fan, let's start git clone.