fypiga
Last Updated: March 02, 2016
·
23.64K
· sheerun

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

11 Responses
Add your response

2356

This is great, thanks!

over 1 year ago ·
2384

I can't get this to work on Windows

over 1 year ago ·
2385

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

over 1 year ago ·
3702

Ubercool!

over 1 year ago ·
3725

Meld :)

over 1 year ago ·
3857

Nice

over 1 year ago ·
4224

@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

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

over 1 year ago ·
10505

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

over 1 year ago ·
11597

@noon-ehos yes st3 works

over 1 year ago ·
11636

@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