This repository is a hands-on Git learning project.
It covers Git fundamentals, branching, merging, undoing changes, and working with remote repositories (GitHub).
The goal is to understand Git practically, not just theoretically.
- Initializing a Git repository
- Tracking files and committing changes
- Understanding commit history
- Working with branches
- Merging branches
- Undoing mistakes safely
- Working with remote repositories (GitHub)
- Fetching, pulling, and comparing changes
git initgit add .git commit -m "first commit"git statusgit log
git log --onelinegit branchgit branch -M maingit branch feature-xgit checkout feature-x
# or
git switch feature-xgit merge feature-xgit checkout -b fix-from-old 1300f39git restore notes.txtgit reset --soft HEAD~1git reset --hard HEAD~1git revert <commit-hash>git fetch origingit log origin/main
git diff main origin/maingit pull origin main- Working Directory → Staging Area → Commit
- Branches are pointers to commits
- Fast-forward vs 3-way merge
- Detached HEAD state
- Reset vs Revert
- Fetch vs Pull
- Safe vs destructive Git commands
This repo is meant for:
- Learning Git step by step
- Practicing real commands
- Understanding mistakes and recovery
- Building strong Git fundamentals
Jubair Abdulla
Learning Git the right way — by practicing 🚀