如何查看 Git 提交中的更改?

当我执行 git diff COMMIT 时,我看到了该提交和 HEAD 之间的更改(据我所知),但我想查看该单个提交所做的更改。

我在 diff / log 上没有找到任何明显的选项,可以给我这样的输出。

As mentioned in "Shorthand for diff of git commit with its parent?", you can also use git diff with:

git diff COMMIT^!

or

git diff-tree -p COMMIT

With git show, you would need (in order to focus on diff alone) to do:

git show --color --pretty=format:%b COMMIT

The COMMIT parameter is a commit-ish:

A commit object or an object that can be recursively dereferenced to a commit object. The following are all commit-ishes: a commit object, a tag object that points to a commit object, a tag object that points to a tag object that points to a commit object, etc.

See gitrevision "SPECIFYING REVISIONS" to reference a commit-ish.
See also "What does tree-ish mean in Git?".

You can also try this easy way:

git show <COMMIT>
</div>