I can get winmerge to show me diffs for modified file. But for new files, winmerge gives a dialog saying 'Left path is invalid!'. I want it to show the left pane as empty and right pane with the contents of the file.
$ git difftool head^ newfile.txt
winmerge Dialog:
I'm on git version 2.8.2.windows.1
This is my git config for difftool:
[diff]
tool = winmerge
[difftool]
prompt = false
[difftool "winmerge"]
cmd = \"C:\\Program Files (x86)\\WinMerge\\WinMergeU.exe\" -e -ub -wl \"$LOCAL\" \"$REMOTE\"
What am I missing?
I could not find this exact workaround so I'm posting this. Hopefully, someone finds it useful.
I use a
winmerge.sh
script which simply passes an already created empty file for newly added (or removed) file. The script is in a dir that's on myPATH
or/git/cmd/
dir for git bash.winmerge.sh (similar to one here)
I keep an empty file
winmerge.empty
at this path$HOME
(which isc:/users/<username>
).I use the
sh
script in.gitconfig
..gitconfig
Note:
To diff untracked files (new files) also before committing, I do
then use
difftool
.-N --no-all
only adds the path of new files to index but not their content (--no-all
is required to NOT stage the deleted files).