Click here to Skip to main content
13,146,402 members (48,891 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 22 May 2010

Git + WinMerge + Cygwin

, 1 Jul 2010
Rate this:
Please Sign up or sign in to vote.
How to use WinMerge to view diffs with Git under Cygwin


This took me a good half day to figure out so I thought it'd be useful to others in a similar situation. It's derived from this post on StackOverflow[^]. You can find more details there but I did have to make a few changes to get it fully working both under Cygwin and a plain Windows command prompt.

Last I checked this was working under:

    • Git

    • WinMerge

    • Cygwin 1.7.5

    • Windows 7 x64

Tying WinMerge to Git

    • Add the following lines to your .gitconfig file:
        tool = winmerge
      [difftool "winmerge"]
        cmd = \"$LOCAL\" \"$REMOTE\"
        prompt = false

      The last option (prompt = false) is optional. You can omit it if you do want Git to prompt you before opening each diff.

    • Create a file named and place it in your path. I just dropped it in my home directory. You can change the default Cygwin path to include your home directory by modifying the .bash_profile file (also in your home directory) and adding PATH=${PATH}:${HOME}

    • Add the following to
      echo "Launching WinMergeU.exe \"$(cygpath -aw "$1")\" \"$(cygpath -aw "$2")\""
      if [ -f $1 -a -f $2 ]
        "C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -u -wl -dl "Base" -dr "Mine" "$(cygpath -aw "$1")" "$(cygpath -aw "$2")"
        echo "skipping as one file doesn't exist"

      Obviously, you may need to adjust the WinMerge installation folder to your local install path.

Running under Cygwin

Just run git difftool.

Running under Windows command prompt

Ensure you have all necessary files in your path:

    • Git binaries


    • WinMerge executable

Run git difftool.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Thiru Thirunavukarasu
Software Developer
Canada Canada
me code

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170915.1 | Last Updated 2 Jul 2010
Article Copyright 2010 by Thiru Thirunavukarasu
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid