git show 显示 commit 提交说明信息

发布时间 2023-07-09 11:33:31作者: 悟透

一、只显示某个 commit 的内容

示例:
1.有多次提交记录。
image



2.只显示 8dd428 这个 commit 的 log

git show 8dd428

image


3.加上 --name-only 参数,只显示文件名,不显示对比差异信息

git show --name-only 8dd428

image


4.加上 --data 设置日期显示方式。
--date 更详细用法 --> git --date时间显示设置格式命令

git show a19f176 --name-only  --date=format:%c

// %c 以系统区域设置的首选格式显示日期

image



二、查看指定commit id对应修改文件列表


示例:

git show --raw commit_id

演示:

git show --raw 9446e75cfa5800e1f1d14ec1651662b45341d935
git show --raw 9446e7

效果:
image



参考:
https://www.cnblogs.com/wutou/p/17490984.html