0

I found ways to use opendiff for "git diff" but "git show" doesn't have quite the same options.

4

2 回答 2

0

根据手册页,在幕后运行以产生差异输出git-showgit diff-tree -cc这可能会绕过您的git-diff自定义。

尝试更改 .gitconfig 以在运行时添加相同的git-diff选项git-diff-tree

于 2012-10-19T00:48:43.110 回答
0

您可以说服 git diff 使用以下技巧向您展示最后两次提交之间的区别:

COMMITS=$(git log --name-status HEAD^^..HEAD | grep "commit" | sed 's/commit/ /')
COMMITS=($COMMITS)
git diff ${COMMITS[1]} ${COMMITS[0]}

在这种情况下,git 将使用您告诉它用于 git diff 的任何编辑器。

于 2012-10-19T20:49:17.760 回答