简体   繁体   中英

Open HEAD and working directory versions of a binary file in git

Is it possible to open the original version (HEAD) of a file in git that's been overwritten in the working directory, without resetting the changes? This would be incredibly useful for viewing before and after binary files (like images), where git does not give useful output.

Ideally, it would be possible to open both versions (perhaps the index too), at the same time, so they could be viewed side-by-side.

You could at least copy that binary elsewhere, in order to be able to open it:

 git show HEAD:yourBinaryfile > /elsewhere

See " In Git: view a file in a different branch without changing branches " for more on git show .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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