TortoiseSVN and DiffMerge

Posted: March 17, 2014 in Miscellaneous
Tags: , , ,

I have used subversion as a source control repository since 2008 along with a tool called DiffMerge from SourceGear.  Of course there are loads of tools out there,  but I have found that this one does a reasonable job of just about everything. That’s pretty much why I am using it for many years.  I particularly like the implementation of the three file view for conflict resolution.

It doesn’t take too much setting up to use with TortoiseSVN.  Below instructions would give you instructions about how to configure tortoise SVN to use diffmerge tool for viewing file differences, merging files and resolving conflicts.

1.1  Diff Merge Tool

Download and install source gear diff merge tool from the below location

DiffMerge is an application to visually compare and merge files and folders on Windows, OS X, and Linux.

  • Diff: Graphically shows the changes between two files. Includes intra-line highlighting and full support for editing.
  • Merge: Graphically shows the changes between 3 files. Allows automatic merging (when safe to do so) and full control over editing the resulting file.
  • Folder Diff: Performs a side-by-side comparison of 2 folders, showing which files are only present in one file or the other, as well as file pairs which are identical, equivalent or different.
  • Windows Explorer/Shell Integration: Right-click on any two files or folders in Windows Explorer to diff them immediately.
  • Configurable: Rulesets and options provide for customized appearance and behavior.
  • International: DiffMerge is a UNICODE-based application and can import files in a wide range of character encodings.
  • Cross-platform: Identical feature set on Windows, OS X, and Linux:

1.2  Tortoise SVN Client

Install Tortoise SVN from the below location

TortoiseSVN is an Apache™ Subversion (SVN)® client, implemented as a windows shell extension. It’s intuitive and easy to use, since it doesn’t require the Subversion command line client to run. Simply the coolest Interface to (Sub)Version Control!

1.2.1 Features of Tortoise SVN
  • Easy to use
    • all commands are available directly from the windows explorer.
    • only commands that make sense for the selected file/folder are shown. You won’t see any commands that you can’t use in your situation.
    • See the status of your files directly in the Windows explorer
    • descriptive dialogs, constantly improved due to user feedback
    • allows moving files by right-dragging them in the windows explorer
    • All Subversion protocols are supported
  • Open the configuration TortoiseSVN configuration settings which are accessed from the TortoiseSVN context menu from any explorer right click context menu as shown.

  • Complete the Global ignore pattern with the following ignores to ensure unnecessary files are not added into the repository:

For example if you would like to ignore resharper related files on the disk,

*.resharper *.user *.suo bin _ReSharper* obj

  • On the External Programs section select Diff Viewer and select the external tool option to configure DiffMerge as the tool to use for difference analysis.  Ensure that the correct path to the DiffMerge executable file is supplied along with command line arguments supplied by TortoiseSVN for comparison files

EX: C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe /t1=Mine /t2=Original %mine %base

Make sure you supply a valid path to the installed DiffMerge product! When displaying changes this will display your version changes in the left panel with base in the right.


  • Select the Merge Tool option on External Programs to configure DiffMerge as the tool to use for Merge operations.  DiffMerge has an excellent three way merge capability described later during conflict resolution.  Ensure the correct path to the DiffMerge executable is supplied along with command line arguments to display the three way merge.

EX : C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe /t1=Mine /t2=Base /t3=Thiers /r=%merged %mine %base %theirs

This will display three columns with your version, followed by the base version followed by the repository version – allowing you to merge changes from both sides into the centre at your leisure…

  1. S Archibald says:

    For the Merge tool options, you have mis-spelled the first instance of the word “theirs”. Please correct.
    C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe /t1=Mine /t2=Base /t3=Thiers /r=%merged %mine %base %theirs

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s