Druudik
Druudik

Reputation: 1015

How do I find commit messages that contain certain words?

I want to search commits in my repository and find ones that contain 2 specific words in their commit messages (say, wordA AND wordB). How can I do that?

Upvotes: 3

Views: 619

Answers (1)

SCouto
SCouto

Reputation: 7926

If the words must go together, just put them between "

git log --grep "wordA wordB"

If they are not together but the order is always the same you can do this with a regex:

git log --grep "wordA.*wordB"

Upvotes: 4

Related Questions