git ls-tree HEAD - meaning of third column -


what string in third column mean when

$ git ls-tree head 

like

enter image description here

the third column key of objects contained tree seeing.

git stores information handles in key-value storage, key being hashes see printed ls-tree or hash created when commit happens.

there 3 kind of objects git saves: commits, trees, , blobs.

you can access contents of of objects git has stored command git cat-file <hash>. example following command (-p pretty printing) print contents of commit object should similar this:

> git cat-file -p head tree def456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa parent f1ddfa625b139184e8b719fcb662e713a77fedcb author bob foo <bob@foo.com> 1358366479 -0800 committer bob foo <bob@foo.com> 1358366479 -0800  commit message. 

the contents of tree object displayed there (the assumed def456...) see when using git ls-tree head. if use following command should see same output:

> git cat-file -p def456aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa # same output as: git ls-tree head 

with hashes displayed there can keep doing same. if use blob object print contents of file, if use tree object, display contents of tree, subdirectory in repository. example see current contents of contact.html file can use:

> git cat-file -p 2271a9 # contents in contact.html 

lastly, check git internals - git objects more information this.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -