如何查看git commit中的更改? [英] How to see the changes in a git commit?
问题描述
当我执行 git diff COMMIT
时,我看到了该提交与HEAD(afaik)之间的更改,但我希望看到该单一提交所做的更改。
我在diff / log上没有发现任何明显的选项可以给我输出。
要查看特定 COMMIT
哈希值的差异:
另外, When I do I haven't found any obvious options on diff/log that will give me that output. To see the diff for a particular Alternatively, 这篇关于如何查看git commit中的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! git diff COMMIT ^ COMMIT
会显示 COMMIT
的祖先和 COMMIT code>。有关该命令的详细信息,请参阅 git diff 的手册页, gitrevisions 关于
^
表示法及其朋友。
git show COMMIT
会做类似的事情。 (提交的数据,包括其差异)请参阅 git show手册页。git diff COMMIT
I see the changes between that commit and HEAD (afaik) but I would like to see the changes that were made by that single commit.COMMIT
hash:git diff COMMIT^ COMMIT
will show you the difference between that COMMIT
's ancestor and the COMMIT
. See the man pages for git diff for details about the command and gitrevisions about the ^
notation and its friends. git show COMMIT
will do something very similar. (The commit's data, including its diff.) See the git show manpage.