Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
167 views
in Technique[技术] by (71.8m points)

beyondcompare - Directory comparison of Git branches

One of my favorite workflows with svn is to use Beyond Compare's folder comparison feature to see the net differences between two branches, or a branch and the trunk. Is there a way to do this in git without having to manually create multiple clones of the same repository?

As I ask this question, it occurs to me that I could write a script that would clone the current repo to a temporary directory, checkout the desired branch, and then call BCompare.exe with the two directories as arguments. The folder comparison view is invoked with

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

Does this sound reasonable? Would I be able to delete the extra clone after I'm done with Beyond Compare?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This (comparing directories instead of file-by-file) should be available soon:
See [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.

See "Patch difftool: teach difftool to handle directory diffs", from this 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...