简体   繁体   English

如何查看来自git存储库的二进制(图像或非代码)文件的较早版本?

[英]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. 我目前正在使用BitBucket的git系统来管理我的存储库。 I see my old code, however when I try to see older iterations of image (PNG) files, all I see are the following: 我看到了我的旧代码,但是当我尝试查看图像(PNG)文件的较早版本时,仅看到以下内容:

历史记录视图

AND when I try to access the image from the older commit: 并且,当我尝试从较早的提交访问图像时:

旧仓库访问

Any input on how to get such files would be greatly appreciated, thanks in advance! 在此先感谢您对如何获取此类文件的任何投入!

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 然后使用浏览器在计算机上查看

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 例如参见https://bitbucket.org/wuub/kmagik/raw/c1fd2c3c64b7/screen1-hi.png

bitbucket的屏幕截图

As mention in this BitBucket documentation , you can use curl to directly get your document. 如本BitBucket文档中所述 ,您可以使用curl直接获取文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM