Hi,
This might be a stupid question, but I did not find any information about it. Can I retrieve previous versions of a file? Let's say, I wanna do a "git annex get file", but considering a specific commit id. Is it possible? Are all the versions of the files kept inside .git/annex/objects?
Thanks!
To get to a specific version of a file, you need to have a tag or a branch that includes that version of the file. Check out the branch and
git annex get $file
.(Of course, even without a tag or branch, old file versions are retained, unless dropped with
unused
/dropunused
. So you could evengit checkout $COMMITID
.)I have an image 'logo.jpg' that is 100kb. I am using indirect mode. I add the logo to the annex; my understanding is that the file contents is stored in .git/annex/....
I do more work in Photoshop to improve logo.jpg. Now, I have a new version of 'logo.jpg' that is 150kb. I add this new version of logo.jpg to the annex.
Does the .git/annex area now contain two instances of the logo.jpg contents, one for the 100kb and one for the 150kb, with metadata pointing to each?
Yes, both versions of the file are stored in
.git/annex/objects
, unless you move them to some other repository, or unless you usegit annex dropunused
to delete the old version.