开发者

How do you list your commits along with their SHA1 values in git?

开发者 https://www.devze.com 2022-12-21 08:56 出处:网络
How do you list your commits al开发者_运维技巧ong with their SHA1 values in git?Exactly what format do you want?For just the one line summary and the SHA1:

How do you list your commits al开发者_运维技巧ong with their SHA1 values in git?


Exactly what format do you want? For just the one line summary and the SHA1:

git log --pretty=oneline

See git log --help for more formating options.


I'm not sure what you mean. Listing a commit is listing its hash, and the easiest way to do it is with git rev-list.

$ git rev-list HEAD

will give the the reverse chronological list of all commits reachable from the current HEAD.


While P00ya's answer is correct, newer versions of git allow a simpler syntax:

git log --oneline

which is shorthand for git log --pretty=oneline --abbrev-commit used together.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号