Skip to content

Instantly share code, notes, and snippets.

@metelkin
Last active October 1, 2018 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metelkin/973498479ab6f9a96f9f3254d2a5b9be to your computer and use it in GitHub Desktop.
Save metelkin/973498479ab6f9a96f9f3254d2a5b9be to your computer and use it in GitHub Desktop.
BAT file to switch file comparison adapted for git difftool
...
; using windows tools to compare files
[diff]
tool=windiff
; set location of windiff.bat
[difftool "windiff"]
cmd = \"C:/windiff/windiff.bat\" \"$LOCAL\" \"$REMOTE\"
...
@echo off
REM 1 - local (source)
REM 2 - remote (destination)
REM as an exaple the file is located in "C:/windiff/"
IF %~x2==.xlsx (
"C:\Program Files (x86)\ExcelMerge\ExcelMerge.GUI.exe" diff -s %1 -d %2
) ELSE IF %~x2==.xlsm (
"C:\Program Files (x86)\ExcelMerge\ExcelMerge.GUI.exe" diff -s %1 -d %2
) ELSE IF %~x2==.xls (
"C:\Program Files (x86)\ExcelMerge\ExcelMerge.GUI.exe" diff -s %1 -d %2
) ELSE (
"C:\Program Files (x86)\WinMerge\WinMergeU.exe" -u -e %1 %2
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment