Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3432378
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:26:30+00:00 2026-05-18T07:26:30+00:00

I like to use git on cygwin, but the only downside I have is

  • 0

I like to use git on cygwin, but the only downside I have is when I want to git difftool I cannot use anything useful. git diff is fine for me most of the time, but sometimes I’d like to use winmerge to view these diffs via git difftool is there some way to set this up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:26:31+00:00Added an answer on May 18, 2026 at 7:26 am

    For cygwin, the SO question “How can I configure Mercurial to use WinMerge for merges, under cygwin?” can be applied to git (when combining the following winmerge script with the older question “use Winmerge inside of Git to file diff“)

    #!/bin/sh
    "/cygdrive/c/Program Files/WinMerge/WinMergeU.EXE" /e /ub /dl other /dr local `cygpath -aw $1` `cygpath -aw $2` `cygpath -aw $3`
    

    Process

    You have more details in this article “Git + WinMerge + Cygwin” (from Thiru Thirunavukarasu):
    (but I would still recommend the WinMergeU.exe options from above)

    Add the following lines to your .gitconfig file:

      [diff]
        tool = winmerge
      [difftool "winmerge"]
        cmd = git-difftool-winmerge-wrapper.sh \"$LOCAL\" \"$REMOTE\"
      [difftool]
        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 git-difftool-winmerge-wrapper.sh 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 git-difftool-winmerge-wrapper.sh:

      #!/bin/sh
      echo "Launching WinMergeU.exe \"$(cygpath -aw "$1")\" \"$(cygpath -aw "$2")\""
      if [ -f "$1" -a -f "$2" ]
      then
        "C:/Program Files (x86)/WinMerge/WinMergeU.exe" -e -u -wl -dl "Base" -dr "Mine" "$(cygpath -aw "$1")" "$(cygpath -aw "$2")"
      else
        echo "skipping as one file doesn't exist"
      fi
    

    (again, do some testing with those WinMerge options)


    Scripts

    If you want to go “all WinMerge”, both for diff and merge git functions, you have this gist page to follow from ecerulm (Ruben Laguna):

    diffmerge-diff.sh

    #!/bin/sh
    # Use SourceGear DiffMerge as mergetool for git in cygwin.
    #   git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
    #   git config --global mergetool.diffmerge.trustExitCode false
    #   git difftool -t diffmerge branch1..branch2
    
    # Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
    
    library=githelperfunctions.sh
    
    #[ -f $library ] && . $library
    . $library
    
    echo Launching DiffMerge.exe - diffmerge-diff.sh: 
    
    set_path_vars "$1" "$2" "$3" "$4"
    
    echo "$diffmergewinpath" -t1=FROM_VERSION -t2=TO_VERSION --caption=$caption $localwinpath $remotewinpath
    "$diffmergewinpath" -t1=FROM_VERSION -t2=TO_VERSION --caption="$caption" "$localwinpath" "$remotewinpath"
    

    diffmerge-merge.sh

    #!/bin/sh
    # Use SourceGear DiffMerge as mergetool for git in cygwin.
    #   git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
    #   git config --global mergetool.diffmerge.trustExitCode false
    #   git mergetool -t diffmerge
    
    # Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
    
    library=githelperfunctions.sh
    
    #[ -f $library ] && . $library
    . $library
    
    echo Launching DiffMerge.exe - diffmerge-merge.sh: 
    
    set_path_vars "$1" "$2" "$3" "$4"
    
    "$diffmergewinpath" --merge -t1=FROM_VERSION -t2=MERGED -t3=TO_VERSION --result="$mergedwinpath" --caption="$caption" "$localwinpath" "$basewinpath" "$remotewinpath"
    
    unix2dos "$merged"
    

    githelperfunctions.sh

    # Helper functions
    
    
    convert_path () {
        file=$1
    
        if [ "$file" == '/dev/null' ] || [ ! -e "$file" ]
            then 
               file="/tmp/nulla"
               `echo "">$file`
        fi
        echo `cygpath -w -a "$file"`
    }
    
    
    set_path_vars () {
        local=$1
        remote=$2
        base=$3
        merged=$4
    
        echo ========= Cygwin paths =======
        echo "LOCAL   :  $local"
        echo "REMOTE  :  $remote"
        echo "BASE    :  $base"
        echo "MERGED  :  $merged"
    
        localwinpath=$(convert_path "$local")
        remotewinpath=$(convert_path "$remote")
        basewinpath=$(convert_path "$base")
        mergedwinpath=$(convert_path "$merged")
    
        echo ========= Win paths =======
        echo "LOCAL   :  $localwinpath"
        echo "REMOTE  :  $remotewinpath"
        echo "BASE    :  $basewinpath"
        echo "MERGED  :  $mergedwinpath"
    
        caption=`basename "$merged"`
        diffmergewinpath="C:/Program Files/SourceGear/DiffMerge/DiffMerge.exe"
        winmergewinpath="C:/Program Files/WinMerge/WinMergeU.exe"
    #   diffmergewinpath=`cygpath -u C:/Program Files/SourceGear/DiffMerge/DiffMerge.exe`
    #   winmergewinpath=`cygpath -u \"C:\Program Files\WinMerge\WinMergeU.exe\"`
    }
    

    winmerge-diff.sh

    #!/bin/sh
    # Use winmerge as mergetool for git in cygwin.
    #   git config --global difftool.winmerge.cmd "winmerge-diff.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\""
    #   git config --global mergetool.winmerge.trustExitCode false
    #   git difftool -t winmerge branch1..branch2   
    
    # Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
    # Reference: http://winmerge.org/docs/manual/CommandLine.html
    
    
    library=githelperfunctions.sh
    
    #[ -f $library ] && . $library
    . $library
    
    echo Launching winmerge.exe - winmerge-diff.sh: 
    
    set_path_vars "$1" "$2" "$3" "$4"
    
    "$winmergewinpath" /dl "LOCAL.$caption" /dr "TO_VERSION.$caption" "$localwinpath" "$remotewinpath" 
    

    winmerge-merge.sh

    #!/bin/sh
    # Use winmerge as mergetool for git in cygwin.
    #   git config --global mergetool.winmerge.cmd "winmerge-merge.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
    #   git config --global mergetool.winmerge.trustExitCode false
    #   git mergetool -t diffmerge
    
    # Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
    # Reference: http://winmerge.org/docs/manual/CommandLine.html
    
    library=githelperfunctions.sh
    
    #[ -f $library ] && . $library
    . $library
    
    echo Launching winmerge.exe - winmerge-merge.sh: 
    
    
    set_path_vars "$1" "$2" "$3" "$4"
    
    # -- use WinMergeU conflictFile
    "$winmergewinpath" "$mergedwinpath"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to use git extensions and I really like it so far, but
I currently use Git, and am generally happy with it, but I'd like to
I'd like to use git to record all the changes to a file. Is
I like to use Emacs' shell mode, but it has a few deficiencies. One
I like to use IPython's zope profile to inspect my Plone instance, but a
Most websites use - (like Stack Overflow) but most PHP frameworks generate + encoded
At work I use ClearCase and SourceSafe, but have found some time to do
I like to use git add --patch (and more recently, git add -i) to
I'd like to use git to manage my various Visual Studio projects. Unfortunately they
We'd like to use git to maintain system configurations. Because sometimes configuration data exists

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.