git - Uncompressing zlib file in command line -
this question has answer here:
- deflate command line tool 16 answers
when git stores snapshot of file, stores object called blob.
this compressed using zlib..see http://nfarina.com/post/9868516270/git-is-simpler; either blind or doesn't explain how file blob uncompressed in fist place (while else explained if noob)
how extract , view contents of blob ? of results googling applied uncompressing within scripts/programs, not manual/cl:
deflate command line tool, https://unix.stackexchange.com/q/22834
i looking single one-line command line way on single file.
thanks in advance!
(even if question sounds duplicate, barrage of answers in other link no way accurate 1 here. think thread should kept alive or answer posted there others non-convoluted way deflate)
use git cat-file -p sha1
view file content of blob.
the content of file this: blob xxx null content
ex:
a.txt contain hello world
the content of sha-1 is:
blob 11\000hello world
, strign gzipped
if on unix u can use deflate content:
perl -mcompress::zlib -e 'undef $/; print uncompress(<>)'
Comments
Post a Comment