我正在尝试将DiffMerge配置为git,以便用于difftool和mergetool。我使用了以下命令:-
命令提示符窗口中的以下命令将更新.gitconfig以配置GIT使用DiffMerge:
C:\> git config --global diff.tool diffmerge
C:\> git config --global difftool.diffmerge.cmd
"C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\"
\"$REMOTE\""`如果我检查.gitconfig的内容,它有以下内容:
` [diff]
tool = diffmerge
[mergetool "diffmerge"]
cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result=\"\" \"\" \"\" \"\"
trustExitCode = true
[merge]
tool = diffmerge
[difftool "diffmerge"]
cmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"\" \"\"
[core]
autocrlf = true
excludesfile = C:\\Users\\dev\\Documents\\gitignore_global.txt
[user]
name = DESKTOP - VAFJEG6\\dev
email = madsum.isalm2@gmail.com `如果我尝试$ git配置--全局配置--列表:-
diff.tool=diffmerge
mergetool.diffmerge.cmd=C:/Program\
Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result="" "" "" ""
mergetool.diffmerge.trustexitcode=true
merge.tool=diffmerge
difftool.diffmerge.cmd=C:/Program\
Files/SourceGear/Common/DiffMerge/sgdm.exe "" ""
core.autocrlf=true
core.excludesfile=C:\Users\dev\Documents\gitignore_global.txt
user.name=DESKTOP-VAFJEG6\dev
user.email=madsum.isalm2@gmail.com`如果我尝试git $ git散化工具,它会显示以下对话框:-

怎么啦?如何正确配置?
发布于 2017-10-15 05:31:50
$LOCAL/$REMOTE 在医生中提到必须由shell (如果是从git bash而不是CMD会话中输入)进行解释,并由""替换。
直接编辑全局配置(git config --global --edit)并添加缺少的元素以获得:
[difftool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
[merge]
tool = DiffMerge
[mergetool "DiffMerge"]
cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' -merge -result="$PWD/$MERGED" "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE"
trustExitCode = truehttps://stackoverflow.com/questions/46745948
复制相似问题