I’m learning git currently and and I have a git repo where I can see a .git directory.
In that directory I can see certain files and folders which I can understand.
But there is one directory named objects. I couldn’t able to think of what they are for.
For example my objects directory has:
04 4a 5f 7a e9 f2 info pack
and for example if see the contents of 04 I can see a file named 12697515217f658b245149a986aba32fa98f38. I couldn’t able to see its contents, it been encrypted.
Can anyone say why the objects folders are for? Why a big hash no like 12697515217f658b245149a986aba32fa98f38?
In any case I can decrypt the contents of 12697515217f658b245149a986aba32fa98f38 and really see how git does its magic?
Thanks in advance.
In
.git/objectgit stores it’s own internal warehouse of blobs, all indexed by SHAs.It is some representation of a blobs tree. It’s faster and more comfortable for different file-systems to keeping all blob directories in that way.
I really hope you can’t decrypt it (it is just compressed, not encrypted as @knittl fairly noticed in the comments).
If you are interested in what stores in
.gitdirectory have a look at that article http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html .