Reputation: 5227
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:
Commit A (Base)
The line without change
The text *before* the change
Another line without relevant change, before
Commit B:
The line without change
- The text *before* the change
+ The text *after* the change
Another line without relevant change, before
commit C:
The line without change
The line of code *after* the change
- Another line without relevant change, before
+ Another line without a relevant change
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
Reputation: 22670
Use git log -G<search pattern>
. For more info, see the second part of this article.
Upvotes: 4