1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/git/grep-over-commit-messages.md
2015-11-22 19:58:55 -06:00

542 B

Grep Over Commit Messages

The git log command supports a --grep flag that allows you to do a text search (using grep, obviously) over the commit messages for that repository. For the git user that writes descriptive commit messages, this can come in quite handy. In particular, this can be put to use in an environment where the standard process involves including ticket and bug numbers in the commit. For example, finding bug #123 can be accomplished with:

$ git log --grep="#123"

See man git-log for more details.