超越同时比较 Diff 2 个分支
>>git difftoolbranch1branch2
打开我的 difftool (Beyond Compare:BC),其中包含分支之间有差异的每个文件。 我必须在每个文件后关闭 BC,以便它可以重新打开下一个文件。
BC 可以比较整个目录和多个文件。
有没有办法让 git difftool 同时打开所有文件,或者同时比较整个树?
>>git difftool branch1 branch2
opens my difftool (Beyond Compare:BC) with every file that has a diff between the branches.
I have to close BC after each file just for it to reopen with the next file.
BC can diff whole directories and multiple files.
Is there a way to get git difftool
to open all files simultaneously, or diff the whole tree simultaneously?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 git v1.7.11 开始,您可以使用
git difftool --dir-diff< /code>
执行目录比较。
以下答案适用于 v1.7.11 之前的 git 安装。
这个问题与BC无关,而是与git的工作方式有关。
幸运的是,这个 URL 有一个解决方案 - git-diffall
Starting with git v1.7.11, you can use
git difftool --dir-diff
to perform a directory diff.The answer that follows applies to git installations older than v1.7.11.
This issue is not related to BC, but to the way git works.
Fortunately, there is a solution at this URL - git-diffall
我使用 这些命令来设置 Beyond Compare 4 (尽管您看到的是 bc3其中)作为差异/合并工具:
git config --global diff.tool bc3
git config --global difftool.bc3.path "C:/Program Files/Beyond Compare 4/bcomp.exe"
git config --global merge.tool bc3
git config --global mergetool.bc3.path "C:/Program Files/Beyond Compare 4/bcomp.exe"
然后我像这样比较了两个分支,其中“oldbranchname”和“newbranchname”是我想要的两个分支的名称进行比较。
git difftool -d --tool=bc3 oldbranchname newbranchname
我得到文件夹视图,就好像我比较了两个文件夹一样。唯一值得注意的是,它在比较中不会显示相同的文件,但这并没有困扰我。
I used these commands to set Beyond Compare 4 (despite the bc3 you see in them) as the diff / merge tools:
git config --global diff.tool bc3
git config --global difftool.bc3.path "C:/Program Files/Beyond Compare 4/bcomp.exe"
git config --global merge.tool bc3
git config --global mergetool.bc3.path "C:/Program Files/Beyond Compare 4/bcomp.exe"
Then I compared two branches like this, where "oldbranchname" and "newbranchname" are the names of the two branches I wanted to compare.
git difftool -d --tool=bc3 oldbranchname newbranchname
I get the folder view as if I compared two folders with beyond compare. The only thing of note is that it will not show identical files in the comparison, but that has not bothered me.