Skip to content

Instantly share code, notes, and snippets.

@xero
Created April 24, 2012 15:29
Show Gist options
  • Save xero/2480631 to your computer and use it in GitHub Desktop.
Save xero/2480631 to your computer and use it in GitHub Desktop.
using winmerge with git diff - replaces unix style null files with a newly created empty windows temp file
#!/bin/sh
# using winmerge with git
# replaces unix style null files with a newly created empty windows temp file
file1=$1
if [ "$file1" == '/dev/null' ] || [ "$file1" == '\\.\nul' ] || [ ! -e "$file1" ]
then
file1="/tmp/gitnull"
`echo "">$file1`
fi
file2=$2
if [ "$file2" == '/dev/null' ] || [ "$file2" == '\\.\nul' ] || [ ! -e "$file2" ]
then
file2="/tmp/gitnull"
`echo "">$file2`
fi
echo diff : $1 -- $2
"C:\Program files (x86)\WinMerge\WinMergeU.exe" -e -ub -dl "Base" -dr "Mine" "$file1" "$file2"
@Carcinie
Copy link

Goes in C:\Program Files\Git\bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment