I am trying to utilize cmd prompt to get the last 10 commits with the author, commit hash, and description to utilize in a form. I have been experimenting with git log --pretty=short
, however, the output seems to go forever.
I would like to know how to reduce the amount of commits returned to the last 10 commits utilizing the git log
command. I plan on extracting the information into a data structure for later use.
Run:
git log -n <number-of-commits> --pretty=short
For all options, see:
https://git-scm.com/docs/git-log
The following command will display the last 10 commits:
git log -n 10 --pretty=short
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With