Git for Beginners: What Actually Matters
A concept-first guide to understanding Git through real project workflows
Why Git Feels Hard (and Why It Isn’t)
By now, you probably understand how important Git is. It appears in almost every job description, open-source project, and team workflow. Yet, for many beginners, Git still feels confusing, complicated, intimidating, or even frustrating.
The problem isn’t that Git is too complex. The real problem is how Git is usually introduced and taught. They start with commands. They will teach you how before why?
This article takes a different approach. We’ll focus on:
What Git actually is?
How Git thinks about change?
A few commands that are truly essential.
The goal is to make Git feel logical, not magical.
What Git actually is (in simple sentences)
Git is a version control system.
What is a version?
the state of your code at a particular point in time.
What does Git do? It helps you
Tracks how your code changes over time.
Saves safe checkpoints of your project. So that you can experiment without fear of losing your code.
Understand and remember what changed, when, and why?
Work with others without overwriting their work.
Important: Git is not the same as GitHub!
Git is a tool that runs on your computer.
GitHub and GitLab are just platforms that host Git repositories online (like a server).
You can use Git entirely offline.
Git’s Core Idea: Local-First Version Control
One of the key problems, Git solved was tracking code changes. This isn't not just about team contributions, as Git can work independently on any local computer.
Git is a local-first, which means it helps manage projects even for individual developers.
Every developer has a full copy of the project's history.
Commits are made on the local machine.
Nothing is shared unless you choose to share it.
This design solves real problems developers faced over years:
No more wondering, "Which is the latest version?"
No more accidental overwrites or manual comparisons
No more reliance on USB drives.
Git is useful even if you are working alone.
How a Project Naturally Grows (Without Git)
Before Git, this is how most projects evolve:
You create a project in some folder of your computer.
You write some code - might build a page/ feature.
You change code and update styles or just refactor.
Sometimes you break things.
Sometimes you want to go back to previous version or code which is working good.
Before Git, developers handled this with
Copies
Folders like
final,final_versionFear of breaking working code.
Git is created as a solution to these. .
So, let’s see how Git fits naturally into a project’s life.
Stage 1: Starting a Project - Repository
Remember, we started the project as a folder in our local computer. To track our project, we need to first let Git see or access our project right?
Usually, Git doesn’t track anything in our computer automatically.
You have to tell Git:
“Hey Git, This folder is the project I want you to track.“
That particular tracked folder is usually called as a Repository.
Command:
git init
This command has to be run in the command line terminal of your project.
This create a hidden .git folder. That folder is where Git stores everything it knows about your project - history, commits, branches and more.
Stage 2: Writing Code - Working Directory
You now start coding:
Creating and deleting files.
Writing code.
Changing and deleting lines.
This is your working directory - the place where you actually work.
At this stage:
Git sees your files and code changes.
But Git does not save them automatically.
By now, Git should be seeing all the files we created right? To check that you can use the command
git status
This command shows “What changed since the last saved point?”
Stage 3: Deciding What Matters - Staging
We won’t save every line of code we wrote, right? We iterate our logics and code in many cases like
Building a feature.
fixing a bug
Removing logs after debugging
Git gives an option where we can choose what and when it needs to be saved. That is called Staging.
Command
git add <filename>
Important:
This does not save anything yet.
It only marks changes as ready to be committed.
Simply, Staging can be considered as preparing changes before taking a commit.
Stage 4: Saving Progress - Commit
Once changes are staged, you can create a commit.
What is a Commit? A commit is
A snapshot of your project till a time frame.
A safe checkpoint.
A saved point you can always return to.
It captures the exact state of files at a specific checkpoint with a message explaining why the changes are made.
Command
git commit -m "describe what change"
After this:
Your work till then is absolutely safe.
You can experiment freely.
You can undo future changes easily.
This is where Git becomes powerful.
Stage 5: Understanding History
As the project and features grows, your commits keep coming up. And Git builds a history of commits.
Each commit:
Points to the previous commit.
Forms a timeline of your project’s evolution.
You can see this by
git log
This answers:
what changed, when it changed, and in what order?
In short, it records your decisions over time.
Stage 6: Parallel Work - Branches
At some point of the project, you will have decent amount of features developed and project will be stable. Now, you might want to try a feature development without even touching the stable codebase.
This is where branches come in
A branch is an independent line of development.
By default, you work on a branch (usually master/ main).
Command
git branch new-feature
git switch new-feature
Now, you can work freely without fear.
Stage 7: Where You Are - HEAD
When working with commits and branches, Git always needs to know one thing.
Where are you right now?
That position is called HEAD.
HEAD points to:
The current branch.
The commit your working directory is based on.
Usually, you don’t move the HEAD manually, Git moves it for you as you commit or switch the branches.
The Complete Mental Model
Git is not about commands. Git is about states.
Working directory → where you edit.
Staging area → what you choose to save.
Repository → saved history.
Commit → a snapshot.
Branch → parallel timeline.
HEAD → where you are now.
Commands are just tools to move between these states.
Conclusion
Git feels hard when you mug up the commands without understanding why Git exists and how it fits into a project’s natural flow. Once you understand that, everything feels connected.
In the next article, we’ll go deeper and look inside the Git itself - what the .git folder contains, how Git stores data, and how commits actually work under the hood.
About the author
Finding the lost charm, code, thoughts, logics, and obsessions - refactoring them one at a time. Documenting the lessons and concepts that I am learning along the way. Simple, maybe. But effective. If you’re rebuilding too, you’re in the right place
Comments
Join the discussionNo comments yet. Be the first to comment.
Git Explained: From Concepts to Commands
Learn Git the smart way with this concept-first series. Understand why version control matters, Git’s mental model, branching, merging, and undoing changes safely. Clear, practical guidance from beginner basics to advanced concepts.