Source Tree resolve conflicts with an external tool

2018-05-21 12_55_29-Sourcetree-blue - Internet Explorer

Source Tree supports multiple external tools to compare differences and resolve conflicts between files. By default you can choose any of this:

Source tree tools

But In this entry I’m going to show how to use it with Meld. 

Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects.

In linux systems it’s very useful and it’s my preffered tool (only when I can’t use diff and merge tools from my IDE).

How to configure

For Windows

Got to main menú an select Tools > Options > Diff tab  and into selection option External Diff  pick Custom and into field Difff Command set the path to your meld binary (on windows is Meld.exe),  into field Arguments set this:

\"$LOCAL\" \"$REMOTE\"

Now for Merge Tool, select the same binary (Meld.exe) and set this into filed Arguments:

--auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\"

Now if you choose any file in your project you can check the diff selecting External Diff or CTRL+D over your file, and meld it’s executed:

extdifmeld

And it’s the same for files in conflict, select your file with the context menu Resolve conflicts > Launch External Merge Tool, now you can view side to side the differences between versions.

extmergemeld

For Mac OSX

Meld is available for OSX here, download and install it.

Select Sourcetree menu > Preferences > Diff tab, on Diff command and Merge command set this value:

open -W -a Meld

For Diff command set  this args:

 --args  $LOCAL $REMOTE

For  Merge command set  this args:

--args --auto-merge $LOCAL $BASE $REMOTE --output=$MERGED

Note:If you want to disable auto backup files (with .orig extension) from git execute this command:

 git config --global mergetool.keepBackup false

And thats all, cheers

References

 

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.