git diff tmp file invalid on windows when using external program on Windows 7 -
i'm following docs git configuration page , trying apply windows 7 environment. when run say, "git diff file0" error in p4merge:
errors: '/tmp/ch9ccm_file0' (or points to) invalid file.
this true statement. not have directory called "/tmp". i've checked in c:\tmp, c:\cygwin\tmp, , %programfiles%\git\tmp.
any ideas on how change directory have?
edit:
additional info. ultimately, i'm trying winmerge (or external program) work. chose use p4merge earlier, because couldn't winmerge work, decided go program used in aforementioned article.
below relevant part of .gitconfig:
[merge] tool = extmerge [mergetool "extmerge"] cmd = extmerge \"$base\" \"$local\" \"$remote\" \"$merged\" trustexitcode = false [diff] external = extdiff
extdiff script:
#!/usr/bin/sh # extdiff # wrapper using external diff tool in git echo "file 1: $2" echo "file 2: $5" /usr/local/bin/extmerge "$2" "$5"
extmerge script:
#!/usr/bin/sh echo $* /c/program\ files\ \(x86\)/winmerge/winmergeu.exe $*
so if change file called index.html, , run git diff, result:
file 1: /tmp/xfgpoc_index.html file 2: index.html
i assume you're using cygwin... think problem cygwin, /tmp exists, windows, doesn't (it's somewhere else). me, cygwin's /tmp located in $home/appdata/cygwin/tmp , that's file was. might different depending on how installed cygwin. once find cygwin's /tmp, it's matter of finding environment variable (or creating new one, if need) windows path temp file. worked me:
[diff] tool = p4mergetool [difftool "p4mergetool"] cmd = p4merge.exe $homepath/appdata/cygwin$local $remote
i used homepath instead of home, because (it appears) homepath windows home environment variable (\users\myusername), while home cygwin home environment variable (/cygdrive/c/users/myusername). cygwin, type printenv see environment variables might fit.
Comments
Post a Comment