Skip to content

Instantly share code, notes, and snippets.

@doha99-eh
Forked from rpdelaney/GIT_BLAME_DELETED.md
Created January 14, 2020 06:43
Show Gist options
  • Save doha99-eh/132198b809f50ebf94115c6b0e23c313 to your computer and use it in GitHub Desktop.
Save doha99-eh/132198b809f50ebf94115c6b0e23c313 to your computer and use it in GitHub Desktop.
git blame for deleted lines

git blame can tell you who last changed a file line by line. But how can you find out who deleted a line?

You can pseudo-git-blame a deleted line using either of the following, depending on whether you want to do a simple string matching search or use a regex:

  1. git log -S [string] ./file
  2. git log -G [regex] ./file
@doha99-eh
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment