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.
精彩评论