.git
directory
At bare minimum, the .git
directory need to contain the following:
.git/
├── objects/
├── refs/
├── HEAD
objects/
: contains Git objectsrefs/
: contains Git referencesHEAD
: contains a reference to the current HEAD
Some additional data
.git/
├── config
├── objects/
├── pack/
├── hooks/
├── info/
config
: per-repository configurationsobjects/pack
: for storing objects in optimized (packed) formatinfo/
: additional metadata
After a commit
After a single commit, the .git
folder will have more information:
.git/
├── COMMIT_EDITMSG
├── index
├── logs/
├── refs/
├── head/main
COMMIT_EDITMSG
: If you don’t use-m
, this file is what git open the editor forindex
logs/
refs/heads/main
: record the commit at top ofmain
branch