dy86xg
Last Updated: February 25, 2016
·
2.687K
· ugorelik
A0d1d8413bb8aa50daf09ed5c1c35320

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.

Say Thanks
Respond

4 Responses
Add your response

14008
Neutral wat

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.

over 1 year ago ·
14048
A0d1d8413bb8aa50daf09ed5c1c35320

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

over 1 year ago ·
16474
01f3945b68ea2938edf23f189aeb1326 normal

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.

over 1 year ago ·
22172
704fa0f35c3a084b3c7ef5e4dc95caf0

Its works for me on Ubuntu :D

Thanks

over 1 year ago ·
Filed Under