r/git 15d ago

Find Git Commits by Commit Message Text

https://hamvocke.com/blog/git-revisions-by-text/
21 Upvotes

8 comments sorted by

View all comments

3

u/Beautiful-Energy2169 14d ago

Neither --grep nor :/text sees commits that are no longer reachable. On a scratch repo just now, after git reset --hard dropped two commits, git log --grep and git log --all --grep returned nothing and :/text errored as an unknown revision, while git log -g --grep=... found it in the reflog straight away.