What the Git?! – A Beginner’s Guide to Version Control and Git


Lets Git Started…
“You don’t need version control,” they said. “Just save your files as final_project_FINAL_v2_revised(3).zip
,” they said.
Well… welcome to a better way of life. Let’s Git started.
Why Version Control?
Imagine you're writing a novel. One day you're feeling poetic, the next day you're Shakespeare on caffeine. You make changes, regret some, and wish you could go back to an earlier version where your protagonist didn't sound like a confused AI. That’s what version control does—for code.
It helps:
Track changes to your files over time
Revert to previous versions when things go south
Collaborate with others without overwriting each other’s work
Keep your sanity intact (mostly)
Enter Git: Your drawer to go back in time
Git is a distributed version control system—which is a fancy way of saying it saves versions of your code both locally and remotely, and lets multiple developers work in harmony (or chaos, but Git doesn’t judge).
It was created by Linus Torvalds (the guy who also built Linux) because he needed a better way to manage a huge open-source project. So yeah, Git's built to handle both your side project and an operating system.
Pay attention: For all the impatient ones or the dopamine junkies who can’t muster up the courage to read through this whole article there is a TL;DR for you guys at the end of this. So you can jump straight to that.
Setting Up Git (aka Initiating Your Jedi Training)
Step 1: Install Git
If you're on:
Windows: Download Git for Windows
macOS: Use Homebrew →
brew install git
Linux:
sudo apt install git
(Debian/Ubuntu)
You can verify it worked using:
git --version
If it returns something like git version 2.41.0
, you're golden.
Step 2: Configure Git
Before we start using it, tell Git who you are:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
This info is stamped on every commit you make. Think of it like signing your code with a digital autograph.
Step 3: Your First Git Project
Let’s make a new folder and turn it into a Git-tracked project:
mkdir hello-git
cd hello-git
git init
Boom. That last command created a hidden .git
folder, which is like Git’s brain. It tracks all changes from now on.
Now create a file:
echo "Hello, Git!" > readme.txt
Check Git’s mood:
git status
Git will say “hey, there’s a new file I don’t know yet.”
Step 4: Tell Git to Track It
git add readme.txt
Then lock it in:
git commit -m "Add readme.txt with a warm greeting"
Congrats you have made your first commit!!!
Pat your back!!!
TL;DR Cheat Sheet
Command | What it does |
git --version | Check if Git is installed |
git config | Set your username/email |
git init | Create a new Git repo in your folder |
git status | See what’s changed |
git add <file> | Stage a file for commit |
git commit -m "msg" | Commit the changes with a message |
Kudos for staying along till here, but this is not the end in fact we have just started , stay along to follow the rest of this series to master Git and GitHub.
Thank you !!!
If you liked this one please make sure to check out my other articles too.
Subscribe to my newsletter
Read articles from Shivay Dwivedi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
