Search git commit messages for a word

You always want to write mean­ing­ful com­mit mes­sages that help you fig­ure out things later. Some­times I use start my com­mit mes­sage with the string ‘wip’ which stands for work in progress and to me, means that the com­mit con­tains break­ing changes. Another prac­tice is to include a bug num­ber in the com­mit. This allows you to later search your com­mit logs for the bug or whater­ver term you are look­ing for using the fol­low­ing command

git log --grep=searchTerm --oneline

That gives you a sim­ple list of one line logs of all the com­mit mes­sages that had the search term that you spec­i­fied. Try it out!

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 *