1

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.

foxiris
  • 3,125
  • 32
  • 32
  • 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 Answers1

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,262,500
  • 529
  • 4,410
  • 5,250