Git is a version control system used by hole world’s developer group. Without git the projects on going process would be much more difficult. In 2005, git was invented by Linus Torvalds. He created it because Linux team need a fast, reliable and distributed way to manage code after their previous tool stopped being free.
Let’s understand how developers actually use it daily, without overwhelming jargon.
1. What is Git?
Git is a distributed & reliable version control system. In simple terms git is a tool that tracks changes in your code over time.
It allows developer to:
a) Save versions of codes
b) Go back to any previous state of code
c) Work with other developers safely with user details
d) Run without breaking any code
2. Why Git is Used (Why Developers Can’t Live Without It)?
Before Git, developers used Pendrives, Email attachments, WhatsApp files, ZIP folders, Manual backups. For this their projects Lost changes of previous code, No backup history, No teamwork features, Endless confusion who write this code.
3. Git Basics & Core Terminologies
Let’s discuss how git work.
A) Repository (Repo):
A repository is just a Git project folder by git software
It has:
a) Your project files
b) Git history
c) Branches
d) Commits
When you run git init in the root folder, it creates a .git folder in your root folder.
B) Working Directory:
The actual folder on your computer where you edit files. Any change you make here is not tracked yet.
C) Staging Area:
The staging area is like a preview basket.
You tell Git:
You wan to save these changes, not everything & do this using “git add ”.
D) Commit:
A commit is a saved snapshot of your project at a specific point in time.
Each commit has:
a) A unique ID
b) Author name
c) Date with time
d) Message to find changes easily
E) Branch:
A branch is a separate line of development.
You can:
a) Add features
b) Fix bugs
c) Experiment, without touching the main code.
F) HEAD:
HEAD points to the commit you are currently on. It’s Git’s way of saying where are we now, like a queue method.
4. Git Workflow
The 3-Step Git Flow
a) You edit files (Working Directory)
b) You select changes (git add for selected file or git add . for all file that are changed & created)
c) You save them (git commit -m )
5. Common Git Commands (With Real Usage)
Let’s understand how git work with commands & how internally save all changes.
A) Initialize Git → git init
Turns your folder into a Git repository.
B) Check File Status → git status
It shows modified files, staged files, untracked files.
C) Add Files to Staging Area → git add or git add .
It tells git to track these changes that are add to git add command.
D) Commit Changes → git commit -m "Add homepage layout"
This saves a permanent snapshot and store in .git folder. Always write clear commit messages so that you or your group members can find it later.
E) View Commit History → git log
It shows:
a) Commit IDs
b) Commit Messages
c) Authors, who save this commits
d) Dates with time
You can go back in time using these commits and find changes code.
6. A Real Developer Workflow
Let’s say you’re building a website and now you create file and use git.
Step 1: Create project:
mkdir my-website
cd my-website
git init
Step 2: Create files:
index.html
style.css
Step 3: Check status:
git status
Step 4: Stage files:
git add .
Step 5: Commit:
git commit -m "Initial website structure"
Step 6: Make changes:
git add index.html
git commit -m "Update homepage content"
7. Local Repository Structure
Let’s assume your projects directory look like this
my-project/
├── .git/
├── index.html
├── style.css
Here .git folder contains all commits, all branches, history. If you delete accidently then all history, user data, commits are deleted.
This is how Head work in .git folder
Commit A → Commit B → Commit C

Top comments (1)
Haha, this is such a solid beginner guide!! Really breaks down Git step by step, from repos and commits to branches and HEAD. Love how it shows the real workflow with commands... it makes Git way less scary for newbies!!