我最喜欢的 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/