How to retrieve a single file from specific revision in Git? - Stack Overflow
I have a Git repository and I'd like to see how some file looked a few months ago. I found the revision at that date, it's: 27cf8e84bb88e24ae4b4b3df2b77aab91a3735d8
. I need to see what did one file look like and also save that to a file.
I managed to see the file using gitk
, but it doesn't have an option to save it. I tried with command line tools, the closest I got was:
git-show 27cf8e84bb88e24ae4b4b3df2b77aab91a3735d8 my_file.txt
However, this command shows a diff and not the file contents. I know I can later use something like PAGER=cat
and redirect output to a file, but I don't know how to get to the actual file content.
Read full article from How to retrieve a single file from specific revision in Git? - Stack Overflow
No comments:
Post a Comment