概要
gitでdiffツールにWinMarge使おうと思ったらBad file numberしてはまったので...
出るエラー
こんなん
git difftool --dir-diff
/libexec/git-core/git-mergetool--lib:
line 121: D:...\WinMarge.exe: No such file or directoryfatal: 'difftool--helper' appears to be a git command, but we were not
able to execute it. Maybe git-difftool--helper is broken?C:\Program Files\Git/libexec/git-core\git-difftool line 464: Bad file number
何が悪いのか
.gitconfig
Windowsではユーザーのホームディレクトリにある。
C:\Users\アカウント名.gitconfig
修正する場合これをメモ帳で開く。
まぁNo such file or directory言われてるしパス周りです。
原因1:パスの区切り文字
パスの区切り文字は\/ではなく\で指定した方が良いのかもしれないが本当かどうか判らない。
怖いなら\で指定する。
原因2:文字コード
UTF-8で保存し直せばいい。
UTF-8で保存されてれば日本語フォルダ名が入ってても問題なし。
原因3:ダブルクォーテーション
パスは必ずダブルクォーテーションで括る。
このとき\をダブルクォーテーションの前につけ忘れがちなので注意。
\も2つ並べないといけない事に注意。
[difftool "WinMerge"]
path = \"D:\\Tool\\WinMerge\\x86\\WinMergeU.exe\"
cmd = \"D:\\Tool\\WinMerge\\x86\\WinMergeU.exe\" -r -u \"\$LOCAL\" \"\$REMOTE\"