git-log-deleted

runs git log for a file path that has been deleted

I’ve needed the git log of a deleted file countless times. Sometimes you want to know who deleted it. Sometimes why. Sometimes you need something from that deleted file. The command to do this requires 3 options and I can never remember it.

git log-deleted path/to/where/the/file/was.txt

Once you’ve got the log, you can then checkout any of the hashes it shows you.

This is a simple wrapper around git log so if the file isn’t found you’ll get a blank response, and a successful exit, because that’s what git log does for files it can’t find.

Usage

Usage: please supply a path to the deleted file you want a log of

Metadata:

Tags:

  • git
  • search