fypiga
Last Updated: March 02, 2016
·
22.15K
· sheerun
Photo on 08.01.2013 at 04.15

Use Sublime Text 2 as Git mergetool

Configure your new merge tool:

git config --global mergetool.sublime.cmd "subl -w \$MERGED"
git config --global mergetool.sublime.trustExitCode false 
git config --global merge.tool sublime

And pro re nata:

git mergetool -y

See also: Just from from viewing in less to editing in Sublime Text 2

Say Thanks
Respond

11 Responses
Add your response

2356
5087ce99840eda8b25e5d6c0ca80d6f7

This is great, thanks!

over 1 year ago ·
2384

I can't get this to work on Windows

over 1 year ago ·
2385
Photo on 08.01.2013 at 04.15

@jchannon You must ensure you have subl command in your path that launches sublime text

over 1 year ago ·
3702
Avatar

Ubercool!

over 1 year ago ·
3725
3065bbad988e551ed3284f7a6a11bd85

Meld :)

over 1 year ago ·
3857
Cfba5caac2948ea97d9ab49a509601bf

Nice

over 1 year ago ·
4224
70e1167dbde5397557b0ec6fabb3d90a

@jchannon just like @sheerun said you have to make a bash alias for subl on Windows. Then this should work.

over 1 year ago ·
4504
6087d2d054570b90649b9b620210ce98

Now with your tip I can use git AND code in the same screen. Brilliant!

over 1 year ago ·
10505
Eb5428926837a8e03919ac478fdc49dc

sublime text 3 will work correct? (OS X Maverick)

over 1 year ago ·
11597
Cory simmons 700

@noon-ehos yes st3 works

over 1 year ago ·
11636
6d3e0b70dbd98fc59352393ce97d7922

@jchannon and other windows users, try this for subl from the command line: http://stackoverflow.com/a/9440776/298758

over 1 year ago ·
Filed Under