如何显示所有提交的哈希ID? [英] How can I show the hash IDs of all the commits?
问题描述
来自 https://stackoverflow.com/a/54314490/10082400 的内容只能显示所选的哈希ID提交
This from https://stackoverflow.com/a/54314490/10082400 can show only the hash IDs of selected commits
git rev-list --ancestry-path $ahash..branch1
这可以显示有关所有提交的各种信息:
This can show all kinds of information about all the commits:
git log --all
如何仅显示所有提交的哈希ID?谢谢.
How can I show only the hash IDs of all the commits? Thanks.
推荐答案
您可以对rev-list
使用--all
选项:
> git rev-list --all
c26b9ea61d21822e965a91096111cf6b16b526cd
726602e78b21c0b7541159f58003bd36398071e7
f581634e4cc2d29d15a0dfbea5d119e10babc847
124ba39cf50af622e4f51d712095dc304d2a69fc
3ff00334516c044a1bceb90234b569412300814a
...
您也可以使用--pretty
标志来精确控制git log
的输出,尽管在这种情况下,我的abbrev
设置缩短了sha1的----no-abbrev
会使它的输出与git rev-list --all
相同:
You can also use the --pretty
flag to control exactly what git log
outputs, although in this case my abbrev
setting shortened the sha1's -- --no-abbrev
would make it output the same as git rev-list --all
:
> git log --pretty=%h --all
c26b9ea61
726602e78
f581634e4
124ba39cf
3ff003345
...
阅读git log --help
或 https://git- scm.com/docs/git-log 了解更多详细信息.
Read up the "Pretty Formats" section of git log --help
or https://git-scm.com/docs/git-log for more details.
这篇关于如何显示所有提交的哈希ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!