0

In discussions about git mentions of the so-called "git database" are not uncommon, but I've never been able to tell (from the context) whether "the git database" refers to the .git directory, or to the .git/objects directory, or to the .git/index file, or something else altogether.

I'm sure that different people, at different times, mean different things by this term, but I'm wondering if there's anything like an "official" (or at least reasonably authoritative1) definition of what the "git database" refers to.

1 For example, a quotation by Torvalds along the lines of "the git database is xyz" would do for me as an authoritative definition.

kjo
  • 33,683
  • 52
  • 148
  • 265

1 Answers1

0

OK, for what it's worth, in the initial commit of the git project, the program implemented in init-db.c basically creates a directory, whose path is, by default, given by the value of the constant DEFAULT_DB_ENVIRONMENT. This constant is defined in cache.h as

#define DEFAULT_DB_ENVIRONMENT ".dircache/objects"

A few commits later, this value gets changed to ".git/objects".

So... .git/objects is the best candidate I've found for what "the git database" refers to.

kjo
  • 33,683
  • 52
  • 148
  • 265