Git or Cry Trying, Seriously
•
10 min read
Save Your Sanity (and Grades)
So you’re coding your assignment at 2 AM, your laptop crashes, and boom — your “final_final_REALfinal_fixed.cpp” is gone.
Guess what could’ve saved you?
Yep. Version Control.
Let’s break it down in a way that doesn’t bore you to sleep.
What Even Is Version Control?
Imagine you're writing a report — like a real paper one — and every time you change something, you photocopy the entire thing and label it:
Report_FINAL, Report_FINAL_EDITED, Report_FINAL_EDITED2, Report_FIXED_THIS_IS_IT, and so on.That’s what most students do with code — they create 17 copies of the same project in different folders, each with slightly different filenames, hoping they don't accidentally open the wrong one.
Version control is the system that stops that madness.
It lets you:
- Save your code properly — with real version history
- Go back in time when something breaks (and trust me, it will)
- Work with friends without copy-pasting files or overwriting each other’s work
The most popular tool for this is Git. And when you upload your code online, that’s usually done through GitHub — like your project’s cloud backup (but cooler).
There’s a very famous analogy people usually use to explain this,
…but I’m not going to mention it. 😌
…but I’m not going to mention it. 😌
Why Should You, a Uni Student, Care?
Because your assignments aren’t safe on your desktop.
Because you will break things.
Because group projects are chaos and Git is peace.
Because you will break things.
Because group projects are chaos and Git is peace.
Plus, here’s the real deal: Git is the industry standard.
Real software engineers use it every day to build apps, websites, and big complex systems.
Real software engineers use it every day to build apps, websites, and big complex systems.
When you learn Git, you can:
- Collaborate on open source projects with developers worldwide
- Manage your own pet projects like a pro
- Show recruiters you know real-world tools (which looks great on your resume!)
Here’s what Git gives you:
Undo Button for Everything
Mess something up? Go back in time. No crying needed.
Group Work Without Killing Each Other
Everyone works on their own part, and Git magically merges it. (…most of the time.)
Your Code is Safe Online
Spilled tea on your laptop? RIP hardware. But hey, your code lives on GitHub.
Looks Smart on Your Resume
Even if you’re panicking inside, your GitHub says: “I’ve got this.”
The 80/20 Rule of Git
There’s a LOT in Git. Like… too much.
But here’s the secret: You only need 20% of Git for 80% of your work.
So don’t stress about becoming a Git wizard on Day 1.
Let’s hit the basics first
How to Git Started (hehe)
1. Install Git
Check if it's working:
git --version
2. Set Up Your Name (So Git Knows Who to Blame)
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Start a Git Project
Inside your project folder:
git init
Congrats, your folder is now watched by Git like a security camera.
4. Add and Save Changes (AKA Commit)
git add .
git commit -m "first commit, pls work"
add .= stage everythingcommit= snapshot your progress
Make good commit messages. No one wants
"finalfixmaybeidk"5. Push to GitHub
- Create a repo on GitHub.
- Then link and push:
git remote add origin https://github.com/yourusername/yourrepo.git
git branch -M main
git push -u origin main
Btw, You can do it the other way around too!
-
Create the GitHub repo first
-
Then clone it to your machine:
git clone https://github.com/yourusername/yourrepo.git
Whichever path you take, just make sure you’re not uploading 200MB of node_modules while you're at it. 😅
🌿 Branching (So You Don’t Ruin Main)
Think of branches like "parallel timelines" of your code.
In Git, you create branches to work on features or fixes without touching the stable code. Once you’re happy with the change, you merge it back.
- You make a branch → try something new
- If it works → merge it back to
main - If it breaks → delete and pretend it never happened
Common strategy?
`main`: This is your clean, production-ready code. Treat it like it’s sacred.
`dev`: Where all the half-working code lives. Useful for testing and combining features.
`feature/*`: New features go here. One feature, one branch. Simple.
`fix-*`: Bugs go here. Even if the bug was caused by your last feature branch, we pretend it wasn’t.
Use
git checkout -b new-branch to create one.GitHub Actions: Let the Robots Work
Ever wondered how your code gets tested automagically?
Enter: GitHub Actions.
They can do things like:
- Run tests when you push code
- Deploy your project
- Post memes when a PR is merged (okay, maybe not by default)
But don't worry — this is more "Level 2 stuff." Just know it exists.
You Don’t Need to Learn Everything
Don’t feel like you have to master Git internals or memorize 27 commands.
Stick to the basics:
init, add, commit, push, pull, checkout, mergeLearn the rest when you need it. Not before.
Version control isn't just for nerds in hoodies. It’s for:
- Students trying to meet deadlines
- Friends trying not to destroy the group project
- Future devs who want to look legit on LinkedIn
Start using Git from your next project — even if it’s just for fun.
Your future self (and your teammates) will thank you.And please, for the love of clean code,
stop emailing.zipfiles to your lecturer.
