Git Repository
For creating the Git Repository, follow the official documentation of GIT:
Git Repository Creation GuideðĶī Git Repository Skeleton
When you run git init
, Git creates a .git
folder. This is the brain of your Git repository.
ð .git Folder Structure
.git/ âââ HEAD âââ config âââ description âââ hooks/ âââ info/ âââ objects/ âââ refs/ â âââ heads/ â âââ tags/ âââ index
ð§Đ Explanation of Contents
- HEAD: Points to the current branch or commit
- config: Repository-specific configuration
- description: Used by Git hosting software
- hooks/: Scripts triggered by Git events (e.g., pre-commit)
- info/: Contains global ignore file (exclude)
- objects/: Stores actual file contents, commits, and trees
- refs/: Stores branches and tags
- index: The staging area (what's ready to be committed)
ð Git Internals
objects/ stores everything Git tracks: blobs (files), trees (folders), and commits.
refs/heads/ stores branch pointers; HEAD tells Git what branch you are on.
ð Analogy
The .git
folder is like the engine room of a ship. It stores your history, current position, and future destination.