Wednesday, March 14, 2012

Setup Tortoise Git and Winmerge


Winmerge has been my favorite diff and merge tool for a long time. I always use Winmerge for those purposes so when I use Tortoise softwares like TortoiseSVN, TortoiseHG, Winmerge always is my first option. Now I prefer same thing with GIT. Unlike TortoiseHG which helps you integrate with Winmerge by 1 single click. TortoiseGIT requires some more steps:

1. For diff tool:

  • Go to Settings
  • Click on Diff Viewer node on the left
  • Enter following line to the textboxes like the picture below. Remember to choose External for the diff tool:

C:\Program Files (x86)\WinMerge\WinMergeU.exe /s /e /x /u /wl /maximize /dl %bname /dr %yname %base %mine

Diff Settings

2. For merge tool:

  • Click on Merge Tool node on the left
  • Enter following line to the textbox like the picture below. Remember to choose External for the merge tool:

C:\Program Files (x86)\WinMerge\WinMergeU.exe /maximize /wl /u /s /dl [%tname]-%theirs /dr [%yname]-%mine %theirs %mine %merged

The parameters can be used are from here: https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html

Merge Settings

Left panel is readonly. For the merge, any write to the right panel will be applied the merged file.
If you're using GitExtensions, you can config WinMerge as the diff tool as well:
"C:/Program Files (x86)/WinMerge/WinMergeU.exe" -s -e -x -u -wl -wr -maximize -dl remote:"$REMOTE" -dr local:"$LOCAL" "$REMOTE" "$LOCAL"
Now, enjoy GIT

Cheers

1 comments:

Unknown said...

Batch files are called so due to their ability to batch or bundle commands together in a single file which otherwise would have to be executed individually. Batch files are typically created for command sequences for which the user may have repeated needs.

winmerge download

Post a Comment