Monday, August 2, 2010

Merging Git with SourceGear DiffMerge



I develop in PHP and C#, switching between OSX (Native Bash) and Windows (Cygwin), so I try to make my solutions as DRY and cross-OS simple as possible. For a great solution for Cygwin checkout Alexander Grob post on the same issue, mine is a slight variation of Alex's.

$ nano ~/.bash_profile
DiffMerge_Path="/cygdrive/c/Program Files/SourceGear/DiffMerge"
if [ -d $DiffMerge_Path ]
then
    PATH="$DiffMerge_Path:$PATH"
fi

In order to make everything cross-OS, I add the DiffMerge binaries to the Path, above is an example on how to add it to Cygwin, adding it to the .bash_profile will ensure that it gets added automatically every time I log in.