Lesson 6 / 28
The .git Directory
Peek inside the .git directory to see where Git stores commits, branches, tags and config.
By Rahul Agarwal · 15 years in web development · Updated 1 Oct 2026
Where the history lives
.git/ holds the entire database: commits, branches, tags, and config. Delete it and the folder is no longer a Git repo — but your files stay.
Never edit it by hand
Everything inside .git/ is managed by Git commands — editing files there directly can corrupt the repository.