如何在不使用git的情况下查看git对象和索引 [英] How to view git objects and index without using git
本文介绍了如何在不使用git的情况下查看git对象和索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你如何以纯文本的形式查看这些文件的内容?
解决方案
请看Object storage format in Git User Manual。
www.zlib.net/rel =nofollow noreferrer> zlib 。可以使用'zlib1g-dev'包中的 zpipe
。使用编译示例 gcc - o zpipe zpipe.c -lz
。它不是标准 .gz
或其他东西。 ./ zpipe -d < .git / objects / 02 / 43019ddb4d94114e5a8580eec01baeea195133
打印blob的内容(header + data) p>
如果你想检查SHA-1,你必须将未压缩的blob放在一个文件中( myblob
)和
sha1sum myblob
Using the OS X terminal,
How an you view the contents of these files as plain text?
解决方案
Look at "Object storage format" in Git User Manual.
It is raw compressed data using zlib. One can use zpipe
from the 'zlib1g-dev' package. Compile the example with gcc -o zpipe zpipe.c -lz
. It is not a standard .gz
or something.
./zpipe -d < .git/objects/02/43019ddb4d94114e5a8580eec01baeea195133
prints the content of the blob (header+data)
If you want to check the SHA-1, you have to put the uncompressed blob in a file (myblob
) and do
sha1sum myblob
这篇关于如何在不使用git的情况下查看git对象和索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文