Use git log to see the last ‘n’ commit messages

Doing a regular git log shows all the log messages until the terminal buffer is full. Sometimes thats not enough, but other times its just too much. What if you only wanted to see the last 5 commit messages, or the last ‘n’ commit messages. Here’s a simple command that lets you do that.

git log --oneline -5

You dont have to use the –oneline option if you want to see more metadata for the commit. 5 represents the size of the list returned by the git log command. Replace it with any number that you wish.

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *