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

发布于 2024-11-29 10:33:49 字数 642 浏览 0 评论 0原文

我想知道是否有一种方法可以设置 git 和 diffmerge,以便当您执行以下命令时: git difftool diffmerge 会弹出并显示所有已修改文件的文件列表,而不是循环浏览通过命令行?

我想这一定是对 ~/.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 的 diffmerge 方式

I'm wondering if there is a way to setup git and diffmerge so that when you execute the following command: git difftool diffmerge pops up and shows you a file listing of all the modified files instead of cycling through them via the command-line?

I'm thinking it must be some setting the ~/.gitconfig file. Here is my current ~/.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

See below for Mercurials (HG) way of presenting DiffMerge.
Mercurial's way of diffmerge

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

我乃一代侩神 2024-12-06 10:33:49

您的 .gitconfig 中应该包含以下几行:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"

You should have the following lines in your .gitconfig:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"
七分※倦醒 2024-12-06 10:33:49

Git 在其默认设置中不提供目录差异。请参阅这个相关的SO问题:

git difftool,立即打开所有 diff 文件,不是连续的

另外,请参阅 GitHub 上的 git diffall 项目,该项目实现了此功能作为附加脚本。

Git does not provide directory diffs in its default setup. See this related SO question:

git difftool, open all diff files immediately, not in serial

Also, see the git diffall project on GitHub which implements this feature as an add-on script.

美男兮 2024-12-06 10:33:49

请注意,您现在可以 (git 1.7.11) diff 目录(即显示在打开 difftool 之前要比较的所有文件)

请参阅“git difftool进行目录比较?

换句话说,git 现在确实“固有地处理文件夹差异”。

Note that you now can (git 1.7.11) diff directories (ie display all the files to be compared, before opening the difftool)

See "git difftool to give directory compare?"

In other words, git now does "inherently handle folder diffs."

红尘作伴 2024-12-06 10:33:49

请查看这里的问题和答案,了解有关使用 diffmerge 设置 git 的详细信息:

OS X 上的 git + DiffMerge 问题

Take a look at the question and answer here for details regarding setting up git with diffmerge:

Problem with git + DiffMerge on OS X

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文