Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you see which commit deleted a file from the repo? [duplicate]

Tags:

Since it is no longer in the repository, I can't do

git log <filename> 

I can run

git log  --diff-filter='D|R' <directory_that_contained_it> 

but that is too much information and grepping it does not seem to list the file I'm looking for.

like image 761
Balint Erdi Avatar asked Mar 07 '12 15:03

Balint Erdi


People also ask

How do you find who deleted files in git?

Listing all the deleted files in all of git history can be done by combining git log with --diff-filter .

How do I see commit history in repository?

On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.

Does git diff show deleted files?

You can use git diff --name-status, that will show you files that where added, modified and deleted.


1 Answers

git log -1 --stat -- <path/to/file> 

I put the --stat in there so that you can verify that the file was deleted.

like image 85
Giorgos Kylafas Avatar answered Nov 01 '22 21:11

Giorgos Kylafas