Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get history/log of a (potentially removed) file in Git

Tags:

git

How can I view history on a particular file (which may have been deleted already in the current trunk)?

Also, what diff tool do you suggest for mac?

like image 505
Blankman Avatar asked Jul 22 '10 18:07

Blankman


1 Answers

Do this to view the history for a file, even if it has been deleted from the current HEAD:

git log -- <filename>

So if you deleted xyz.py a few revisions ago but would like to view its history, then you would do:

git log -- xyz.py
like image 131
David Underhill Avatar answered Oct 28 '22 16:10

David Underhill