What is objects/17 git directory?


Can anyone explain that purpose of objects/17 directory inside .git directory?


1 answer

1 accepted

Each 'git commit'

  • creates a unique commit Id (160-bit SHA-1 hash - calculated from the contents of the commit)
  • stores its data within the folder .git/objects within subfolders

==> The subfolders are created from the first two characters of your current commit-ID. The files within the subfolders are named from the rest of your commit-ID

This splitting is probably done to avoid thousands of files within a single folder.



Your commitID is 17556a21ebc68ce39bb53f26af9a590eb76d8c46

-> corresponding data is stored within .git/objects/17/556a21ebc68ce39bb53f26af9a590eb76d8c46




Bitbucket server code (GC scheduler) used exactly objects/17 dir. This is some of special directory i guess, but i can't find any docs about this directory.

And, yes, i know that is two first symbols from commit hash. My question is little bit another smile

Bitbucket Server checks how many loose objects there are in the 17 directory to decide whether a gc needs to be run. The assumption is that loose objects should be reasonably evenly distributed across the different object directories, so the count in 17 is a reasonable indicator. There's nothing special about 17 though..


If directory does not exists will GC never executed?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,448 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you