Is production: true
#migrated #outdated

Title: How to setup git diff in windows

Created: 19 May 2020 Modified: 19 May 2020

Description: The below how to demo how to set up the diff tool to git on windows with `WinMerge`.



Ref Links:

Instructions

  1. Find out the git configuration location

    #This command shows the git configuration location
    git config --list --show-origin 
    
  2. Let’s say use the ~/.gitconfig

    vim ~/.gitconfig
    #=== Append lines below
    # $BASE => the temp directory path
    # $LOCAL => the first diff commit
    # $REMOTE => the second diff commit
    [difftool "winmerge"]
            cmd = {path to winmerge.exe e.g. /Y/Softwares/WinMerge/WinMergeU.exe} -e -u -r -wl -wr -dl \"$BASE\" -dr \"$BASE\" \"$LOCAL\" \"$REMOTE\"
    
    #=== Diff by
    git difftool -y --dir-diff {first commit} {second commit}
    

[Legacy Link]