-1

I'm trying to get all commits in my Git-Repository which commit messages contain a specific text.

Is there a feature in Git which can get me the commits? Is it possible to get what I want in another way so I could write a short script that displays the commit-ids?

Thank you in advance.

Daniel Müller
  • 426
  • 1
  • 5
  • 19
  • 1
    Might help you.. Not painful believe me XD https://www.google.com/search?client=ubuntu&channel=fs&q=preg+in+git&ie=utf-8&oe=utf-8#channel=fs&q=preg+expressions++in+git – Asim May 20 '14 at 12:06

1 Answers1

3

You can use the git log --grep="specific text" to find the regular expression in commit messages.

If you want to get only the list of SHAs, you have to add the --pretty=format:%h switch which will print the 7 character long SHA of the commits, or use %H instead of %h to print the full SHA.

bimlas
  • 2,359
  • 1
  • 21
  • 29