1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00

Add Grep Over Commit Messages as a git til.

This commit is contained in:
jbranchaud
2015-11-22 19:58:55 -06:00
parent 8c4fa5e16b
commit 5bc288aef8
2 changed files with 15 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
- [Dry Runs in Git](git/dry-runs-in-git.md)
- [Excluding Files Locally](git/excluding-files-locally.md)
- [Grab A Single File From A Stash](git/grab-a-single-file-from-a-stash.md)
- [Grep Over Commit Messages](git/grep-over-commit-messages.md)
- [Ignore Changes To A Tracked File](git/ignore-changes-to-a-tracked-file.md)
- [Intent To Add](git/intent-to-add.md)
- [Last Commit A File Appeared In](git/last-commit-a-file-appeared-in.md)

View File

@@ -0,0 +1,14 @@
# 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:
```bash
$ git log --grep="#123"
```
See `man git-log` for more details.