我想知道是否有一种方法可以设置 git 和 diffmerge,以便当您执行以下命令时: git difftool
diffmerge 会 pop 并显示所有已修改文件的文件列表通过命令行循环遍历它们?
我想这一定是对 ~/.gitconfig 文件的一些设置。这是我当前的 ~/.gitconfig:
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
[mergetool]
keepBackup = false
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge $LOCAL $REMOTE
请参阅下面的 Mercurials (HG) 呈现 DiffMerge 的方式。
最佳答案
您的 .gitconfig
中应该包含以下几行:
[diff]
tool = diffmerge
[difftool "diffmerge"]
cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"
关于带有 DiffMerge 设置的 git 来模仿带有 diffmerge 的 Mercurials 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7069413/