3

I'm trying to do something which I think should be simple. I have two old commits in the log, X and Y (where X and Y are commit hashes). I want to see a visual, Directory representation of the differences between the two commits, so I run:

git difftool -d X Y

But this gives me a large number of differences which are not between the two commits.

If I create a brach b1 from X and a branch b2 from Y, then the command works as expected (git difftool -d b1 b2).

Can someone please explain my error in execution and thinking?

4

1 回答 1

2

据我所知,无论您是通过 SHA-1 对象名称还是分支名称指定提交,行为都应该没有区别(请参阅gitrevisions参考中的指定修订),所以这看起来可能是一个错误.

如果你使用git difftool而不是,你会得到正确的差异git difftool -d吗?如果你用git diff怎么办?(所有三个都应该给出一组更改——只是显示不同。)也许还可以尝试使用不同的工具来实际执行差异?

于 2014-10-21T16:00:34.557 回答