Say I have a keyword Tom and I forgot that keyword in which file (because it already deleted) but I know in a certain branch. I want to find which commit delete this keyword.
Asked
Active
Viewed 88 times
1
foxiris
- 2,563
- 26
- 30
-
Not exactly a dupe, but it answers your question perfectly: [How do I “git blame” a deleted line?](https://stackoverflow.com/questions/4404444/how-do-i-git-blame-a-deleted-line) – Amadan Aug 29 '19 at 04:34
1 Answers
2
Finding all commits which introduced to deleted a word is a pickaxe search (see diffcore)
git log -S"my expression" aBranch
To see the delta (and deletion)
git log -p -S"my expression" aBranch
The alternative approach with git blame would suppose you know where the expression was, which is not the case here.
VonC
- 1,129,465
- 480
- 4,036
- 4,755