helt
helt

Reputation: 5227

How can I find commits in which a specified change happened?

How can i find commits in which a specified change happened? In this case, neither the exact filename nor the exact linenumber are known. Its basically a raw search. I.E. i search for the commits in which a line contains a change from "before" to "after".

ie. commit history as follows:

As a result i just want to have the hash for commit B. I basically need all changes in all files.

Upvotes: 2

Views: 78

Answers (1)

thSoft
thSoft

Reputation: 22670

Use git log -G<search pattern>. For more info, see the second part of this article.

Upvotes: 4

Related Questions