Git repository

the .git directory serves as the git repository

In Git terminology, the git repository is the .git directory managed by git. It is a hidden directory that lives at the root of the project. It stores all versioning data.

Because the directory stores all the project's data, we sometimes conflate it with the project directory itself, the one that lives locally and that contains both the working tree and the git repository proper.

enable git versioning in a project

The git init command creates the .git repository and enables git commands.

git init

.git directory content

files and directories

COMMIT_EDITMSG
FETCH_HEAD
HEAD
ORIG_HEAD
config
description
index
packed-refs

hooks/
info/
logs/
objects/
refs/

project specific configuration

the configuration file lives at .git/config

open .git/config
earlymorning logo

© 2025 - All rights reserved

Git repository

the .git directory serves as the git repository

In Git terminology, the git repository is the .git directory managed by git. It is a hidden directory that lives at the root of the project. It stores all versioning data.

Because the directory stores all the project's data, we sometimes conflate it with the project directory itself, the one that lives locally and that contains both the working tree and the git repository proper.

enable git versioning in a project

The git init command creates the .git repository and enables git commands.

git init

.git directory content

files and directories

COMMIT_EDITMSG
FETCH_HEAD
HEAD
ORIG_HEAD
config
description
index
packed-refs

hooks/
info/
logs/
objects/
refs/

project specific configuration

the configuration file lives at .git/config

open .git/config