Misha Moroshko
Misha Moroshko

Reputation: 171379

Where is the commit object after "git clone ..."?

After I typed git clone <path to project> I see that .git/refs/heads/master was created with SHA1_code inside.

Though I see that SHA1_code points to a commit object (by typing git cat-file -t SHA1_code), I couldn't find this commit object in .git/objects.

Where is this commit object ?

Upvotes: 0

Views: 104

Answers (1)

sehe
sehe

Reputation: 393164

It's probably in a pack

Refer to Packfiles (Pro Git Chapter 9-4) to learn more about the git object database

The initial format in which Git saves objects on disk is called a loose object format. However, occasionally Git packs up several of these objects into a single binary file called a packfile in order to save space and be more efficient. Git does this if you have too many loose objects around, if you run the git gc command manually, or if you push to a remote server. To see what happens, you can manually ask Git to pack up the objects by calling the git gc command:

Upvotes: 2

Related Questions