0

I'm trying to find all commits made by Matt, but in my repository there are a couple of users with similar names (e.g., Matthew), and git log --author="Matt" covers these users that are not Matt.

Is there a way to say to git do not be that smart and filter only the string that I'm looking for?

1 Answers1

3

If you read this answer carefully, and the git log docs, you could do that either by:

  • using -F flag (which treats the string as a string to look for, not a pattern), or
  • using -E flag along with a regexp

Note that to do that, you have to think of the author as the full author name, which I believe is the same, that git log without filtering prints.

Using -F flag (I checked it for me and it worked):

$ git log -F --author='Matt <matt@matts.email.com>'

Using regexp:

$ git log -E --author='^Matt\s<(.+)>$'

I tested both on my git console, and both worked.

Community
  • 1
  • 1
Kleskowy
  • 2,618
  • 1
  • 15
  • 18