git - Git分支的目录比较

标签 git beyondcompare beyondcompare3

我最喜欢的 svn 工作流程之一是使用 Beyond Compare 的文件夹比较功能来查看两个分支或分支与主干之间的净差异。有没有办法在 git 中执行此操作而无需手动创建同一存储库的多个克隆?

当我问这个问题时,我突然想到我可以编写一个脚本来将当前存储库克隆到一个临时目录,检查所需的分支,然后调用 BCompare.exe 并将这两个目录作为参数。调用文件夹比较 View

BCompare.exe path/to/folder1 path/to/folder2

这听起来合理吗?完成 Beyond Compare 后,是否可以删除多余的克隆?

最佳答案

这(比较目录而不是逐个文件)应该很快可用:
参见 [ANNOUNCE] Git 1.7.11.rc1 :

"git difftool" learned the "--dir-diff" option to spawn external diff tools that can compare two directory hierarchies at a time after populating two temporary directories, instead of running an instance of the external tool once per a file pair.

参见“Patch difftool: teach difftool to handle directory diffs”,来自fork of git :

When 'difftool' is called to compare a range of commits that modify more than one file, it opens a separate instance of the diff tool for each file that changed.

The new '--dir-diff' option copies all the modified files to a temporary location and runs a directory diff on them in a single instance of the diff tool.

关于git - Git分支的目录比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4248830/

相关文章:

git - OpenSSL errno 10054,连接被拒绝,同时尝试连接到我们的服务器

git - 创建带格式的 'git log' 别名

c# - 预提交钩子(Hook)修改AssemblyInfo

Android studio 1.4和VCS(git)无法提交代码

atlassian-sourcetree - 如何在源树中链接外部差异工具(超越比较)?

git - 使用 git hooks 为当前提交更改的每个文件创建差异报告

compare - 超越比较以正确匹配相似的行

mercurial - 在 TortoiseHg 中使用 Beyond Compare 进行视觉差异

date - 忽略超越比较文件比较中的日期列

csv - 在 Beyond Compare 3 中比较 CSV 文件 : How to ignore/filter out lines that don't exist on right i. e.只显示数据不匹配的行