How does git store tree objects?

I am trying to understand the exact format of how git stores tree objects. How is the hash of a tree object calculated?

+5
source share
2 answers

tree object

'tree' ' ' size_decimal '\0' tree_content

for each entry in tree_content

mode ' ' filename '\0' hash_20_bin

mode: 100644 for a regular file, 100755 executable file; 040000: tree; 120000: symbolic link; 160000: gitlink

table http://linquize.blogspot.hk/2011/10/supplemental-information-for-git.html

+8
source

( "", ), . (). , SHA1- . .

git ls-tree git cat-file -p . : SHA-1 , , ( "blob", "tree" ) .

. , , .

+6

All Articles