Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Search Your Git Commit Log

DZone 's Guide to

How to Search Your Git Commit Log

Want to learn how to finding code that was changed in a commit? Click here for the code snippet that searches for a specific term in your commit history.

· Open Source Zone ·
Free Resource

This is more for reference in the future. But if you want to search your commit history for a specific term that changed in one of your commits, then you can issue the following command:

git grep your-regex-here $(git rev-list --all)


For example, I did git grep "\'load" $(git rev-list --all) to find the commit that caused me to remove ‘load.'

Neat.

Topics:
git ,commits ,grep ,log ,example ,open source ,os ,commit history

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}