Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to checkout a specific single file at a specific timepoint to a different file

Tags:

git

I'd like to checkout a copy of a file at from June 15th at 12noon of this year. I was thinking something like this:

git checkout file.txt 'master@{2013-06-15 12:00:00}' file-a-week-ago.txt

But no dice. Any advice on how to do this?

Thank you!

like image 798
timpone Avatar asked Jul 25 '13 21:07

timpone


1 Answers

Simple, use show and redirect to the other file:

git show 'master@{2013-06-15 12:00:00}':file.txt > file-a-week-ago.txt
like image 65
yonosoytu Avatar answered Nov 04 '22 12:11

yonosoytu