Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: Stepping through a single file's history

From: John Tapsell <hidden>
Date: 2016-06-15 22:48:07

2010/1/29 John Tapsell [off-list ref]:
2010/1/29 Ron Garret [off-list ref]:
quoted
Hello,

Is there an easy way to step through the history of a single file?  To be more specific:
...
quoted
(The use case here is remembering that back in the day there was some useful code in this file that I want to retrieve, but not remembering exactly when it was deleted.  So I want to step back through this file's history and do diffs against HEAD.)
How about simply doing:

git log -p filename
You can also do like:

git show HEAD~3:path/filename

where path is the path from the top of the git repository.  This would
show the file as it was 3 revisions ago.

You can also do like:

git checkout HEAD~3 filename

to checkout the first as it was 3 revisions ago.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help