Repository

the .git directory serves as a repository

Strictly speaking, the git repository is the .git directory managed by git. It is hidden by default and lives at the roof of the project. It stores all the data and metadata. The working directory is reconstructed from it.

In a broader sense, we sometimes consider the project's root directory as the repository, the one that includes both the .git directory and the working directory.

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

Repository

the .git directory serves as a repository

Strictly speaking, the git repository is the .git directory managed by git. It is hidden by default and lives at the roof of the project. It stores all the data and metadata. The working directory is reconstructed from it.

In a broader sense, we sometimes consider the project's root directory as the repository, the one that includes both the .git directory and the working directory.

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