Louis93
Louis93

Reputation: 3923

How do I view older iterations of binary (image or non-code) files from a git repository?

I am currently using BitBucket's git system to manage my repositories. I see my old code, however when I try to see older iterations of image (PNG) files, all I see are the following:

History View

AND when I try to access the image from the older commit:

Old Repo Access

Any input on how to get such files would be greatly appreciated, thanks in advance!

Upvotes: 2

Views: 1221

Answers (2)

Adam Dymitruk
Adam Dymitruk

Reputation: 129654

You can check it out locally as well with

git checkout HEAD^^^^^^ -- path/to/pic.png

or if you want to put it somewhere else

git show HEAD^^^^^^:path/to/pic.png > /some/other/path/pic.png

and then view it on your machine with a browser

Upvotes: 3

VonC
VonC

Reputation: 1326736

You should see your file, using the address accessing the raw content:

https://bitbucket.org/<username>/<repo>/raw/<revision>/yourpicture.png

See for instance https://bitbucket.org/wuub/kmagik/raw/c1fd2c3c64b7/screen1-hi.png

screenshot from bitbucket

As mention in this BitBucket documentation, you can use curl to directly get your document.

Upvotes: 2

Related Questions