带有 DiffMerge 设置的 git 来模仿带有 diffmerge 的 Mercurials 设置

标签 git mercurial diffmerge

我想知道是否有一种方法可以设置 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 的方式。 Mercurial's way of 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/

相关文章:

git - 如何在git中将文件 "Un-push"?

git - merge 未在任一分支中修改的文件中的冲突

Mercurial - 查看 hg out 中列出的所有变更集中的所有文件的差异?

mercurial - 使用 Mercurial 队列将未提交的更改添加到新补丁中

git - 将 diffmerge 设置为可视 Git difftool 不起作用

GitHub:权限被拒绝(公钥)。 fatal: 远端意外挂断

Git:从远程存储库自动获取?

mercurial - 如何定义 hg 忽略异常?

mercurial - 如何使 diffmerge 与 Mercurial 进行三向 merge ?

git - OS X 上的 git + DiffMerge 问题