A super simple guide to Git basics. Learn why version control is important, track changes, save snapshots (commit), send code to the cloud (push), and get updates from others (pull).
If you've ever experienced:
loss of important code changes
Wanting to go back to a code that "worked yesterday."
Scared to break something that used to work
Wondering how teams work on the same project without interfering with each other
Then Git is the one tool that solves all these.
Git is the most popular version control system simply because it lets you:
Take snapshots of your project (commit)
Track exactly what changed and when
Go back in time if something breaks
Work conveniently with others (push & pull)
Now to the essentials, nothing overwhelming, just some everyday commands.
1. What is Version Control?
Let's say you have a project folder and it's the only one you have,
Without git → You only have that one copy, and if you delete something or break the code, it's gone unless you manually saved copies or otherwise.
With git → Every important change is snapshotted (a commit). Which means you can:
Read any previous project
Compare projects
Go back to an older project
Let someone else add their own project safely
2. Quick Setup
- Install Git
- Let git know who you are (do this after opening git)
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Use the same email as in your GitHub account
3. The Core Git Workflow (The Repeat Cycle)
Edit files → See what changed → Stage changes → Save snapshot (commit) → Send to cloud (push) → Get others' changes (pull)
Let's go through each one of them step by step.
Step 1: Create or move into a project folder
mkdir my-first-project
cd my-first-project
Step 2: Tell Git to start tracking this folder
git init
(You only do this once per project)
Step 3: Make some changes & see what's different
Create or edit a file (e.g index.html, app.js, README.md)
Ask git what changed?
git status
It'll bring something like:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
modified: index.html
new file: styles.css
Untracked files - new files Git doesn't know yet
Modified - Git knows but have changes
Step 4: Choose which changes to save (Staging)
# Add one file
git add index.html
# Add everything that changed
git add .
# Or add interactively
git add -p
git status now shows:
Changes to be committed:
new file: index.html
modified: styles.css
Step 5: Save the snapshot (Commit)
git commit -m "Add homepage layout and basic styling"
Make the message short and clear, e.g:
"Add user login form"
"Fix mobile menu not closing"
"Update README with installation steps"
Step 6: See the history of snapshots
git log --oneline
Example output of what it'll show:
a1b2c3d Add homepage layout
e4f5g6h Initial project structure
Each line - snapshot with its unique ID
Step 7: Send your work to the cloud (Push)
First, create an empty repository on GitHub.
Then connect your local project:
git remote add origin https://github.com/your-username/your-repo-name.git
Then send your commits:
git push -u origin main
(If default name is master instead of main, replace main with master)
From here now, you can just do:
git push
Step 8: Get changes from others/another computer (Pull)
git pull
This does 2 things:
- Download new commits from the remote (fetch)
- Merges them into your current branch
Important: Always git pull before starting new work
Quick Reference (Commands and when to use them)
See what changed - git status - All the time!
Add specific changes - git add filename - Before committing
Add all changes - git add . - Common & fast
Save snapshot - git commit -m "message" - After staging good changes
See commit history - git log --oneline - When you want to remember what you did
Send to GitHub - git push - When your work is ready to share/backup
Get latest changes - git pull - Before starting work / after coming back
Undo staging (if you added by mistake) - git restore --staged filename - Oops moments
That's it! You now know how to track changes, save versions, push your work, and pull updates.
Happy coding and committing!


Top comments (7)
Nice one nailed it
Appreciate it!!
Great article Owen,looking forward to a rewarding journey ahead coursemate.
Looking forward to this promising journey, brother!!!
Well done
Thank you
nice one