Career / 5 min read
From Zero to Hero: Mastering Git for New Developers
The Git cheat sheet I wish I had when I started.
From Zero to Hero: Mastering Git for New Developers
The Git cheat sheet I wish I had when I started.

Git looked like magic when I started coding.
Also terrifying.
I know this as I have seen many good developers and coders, but still scared of Git.
I remember running git push with my fingers crossed—praying I didn’t break anything. And let’s not even talk about merge conflicts and git history… I thought I had ruined my entire project once.
Fast-forward to today: Git is my best friend.
And no, it’s not because I memorized 200 commands. It’s because I learned how to use just the right ones that actually matter in real dev life.
If you’re new to Git or still scared of the terminal, this guide’s for you.
Not just to learn Git, but to master it with confidence.
► If you don’t have Medium membership, you can read here
Basic Git Commands You’ll Use Daily
Let’s start with your Git survival kit — the ones you’ll use over and over again:
# These listed commands are the daily used commands for GIT
git init # Start a Git repo in your current folder
git status # See what's changed
git add . # Stage all changes
git commit -m "message" # Save changes with a message
git push # Upload your changes to GitHub
git pull # Get the latest from the remoteRun these often, and you’ll start feeling comfortable with Git.
Branching = Real Power
Branches let you work on features without breaking your main codebase. It lets you work in teams and collaborate.
Branch simply can be understood as something with is part of main tree(main) and we’re cutting it out to add some of our features(feature_branch)
git pull # let's you pull the main branch
git checkout -b feature/login # Create and switch to a new branch from main (Now this branch will have everything of main branch)
git checkout main # Switch back to main
git merge feature/login # Merge changes into main (Mostly we don't merge the changes at local in main branch, we raise a PR which ones get approved by the reviewers then only our feature branch will get merged)Pro Tip:
Always use a new branch for a feature, fix, or refactor. It makes collaboration, testing, and debugging 10x easier.
When Things Go Wrong (And They Will)
Here are the Git commands that saved me more than once:
git log # See your commit history
git diff # Check what changed before committing
git stash # Save your current work temporarily
git reset --hard # Undo all local changes (use with care!)
git revert <commit> # Revert a specific commit safely
git reset --hard HEAD~1 # This is barely used command, but I use it mostly (This command wil revert your commited changes to local which aren't pushed)Think of these as Git’s undo buttons — lifesavers during those late-night “oops” moments.
Push. Pull. Repeat. But Carefully.
When working with a team:
git pullbefore you push, so that you have all the changes, don't by other devs.- Always resolve merge conflicts before merging
- Test before pushing — broken code on
mainormateris everyone's nightmare
Bonus? Use pull requests to keep reviews smooth and organised (especially on GitHub).
Workflows That Actually Work
Here’s a real-life dev workflow I follow:
1. git checkout -b feature/xyz
2. Code, code, code
3. git add . && git commit -m "feat: added xyz"
4. git pull origin main --rebase
5. git push origin feature/xyz
6. Create a Pull Request → Get reviewed → Mergegit pull origin main — rebase— This command will get the latest changes from the main, andrebasewill make your local commits on top of themainbranch.
Final Thought
You don’t need to be a Git Master in one day.
But if you master these core concepts, you’ll never fear version control again. I know reading it can feel overwhelming, but if you just try it once, it can’t be easier.
And soon, Git won’t just be your tool — it’ll be your superpower.
Note for Readers
Are you scared of GIT? Share your thoughts in the comment box, may be I or somebody else can help you with it.
If you like reading my articles, you can always support my writings by buying me a cup of coffee here ☕️ . Let me take the hot sip and enjoy 😉
At Dev Simplified, We Value Your Feedback 📊
👉 Struggling to land your dream job or get a better package? Double your current salary in just 90 days. Book your clarity call now!
👉 Have any suggestions? Let us know in the comments!