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.