Open all files with merge conflicts (with Sublime)
git diff --name-only | uniq | xargs subl
I found it useful to create an alias too:
git config --global alias.cf '!sh -c "git diff --name-only | uniq | xargs subl"'
And of course you can substitute subl
for your favorite editor.
Written by Uri Gorelik
Related protips
4 Responses

This is odd. I am getting:
git diff --name-only | uniq | xargs subl
xargs: subl: No such file or directory
but then when I do which subl, it says:
subl: aliased to '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'
Any help is appreciated.

Maybe you need to do a symbolic link on sublime: https://www.sublimetext.com/docs/2/osx_command_line.html

It also really helps to add -n after subl if you want the merge conflicts to open in a new sublime window. If you are currently working on many files (including the ones with merge conflicts), using -n ensures you will see ONLY the files with merge conflicts in this new window.

Its works for me on Ubuntu :D
Thanks