November 19, 2025
Top 15 Git Features Every Developer Should Know
Git can feel overwhelming, but once you learn a handful of powerful commands and workflows, your speed and confidence go way up. These are…

By Prince kumar Maurya
1 min read
Git can feel overwhelming, but once you learn a handful of powerful commands and workflows, your speed and confidence go way up. These are the features that matter the most in real development work.
1. Git Branching
Branches let you work on new features without touching the main code.
git checkout -b feature/logingit checkout -b feature/loginThis is the foundation of modern workflows like Git Flow, trunk-based development, and feature branching.
2. Git Stash
Temporarily saves your uncommitted changes so you can switch branches.
git stash
git stash popgit stash
git stash popSuper useful when someone says, "Pull the latest code real quick."
3. Git Rebase
Rewrites commit history to keep your branches clean.
git rebase maingit rebase mainUsed for creating a neat, linear commit history instead of "merge spaghetti."
4. Git Merge
Combines branches. Keep history intact (good for collaborative work).
git merge feature/logingit merge feature/loginIf you want safety over cleanliness, choose merging instead of rebase.
5. Git Cherry-Pick
Copy a specific commit from one branch to another.
git cherry-pick <commit-hash>git cherry-pick <commit-hash>Great for hotfixes without merging entire branches.
6. Git Reflog
Your time machine. Even if you "lost" commits or reset incorrectly, reflog brings them back.
git refloggit reflogEvery developer eventually gets saved by this.
7. Git Reset (Soft, Mixed, Hard)
Used to undo commits.
- Soft: keep changes staged
- Mixed: keep changes unstaged
- Hard: delete everything to match history
git reset --soft HEAD~1
git reset --hard HEAD~1git reset --soft HEAD~1
git reset --hard HEAD~1Be careful with --hard.
8. Git Amend
Fix the last commit (message or content) without creating a new commit.
git commit --amendgit commit --amendPerfect for typos or missing files.
9. Git Blame
Shows who changed which line and when.
git blame file.jsgit blame file.jsUseful for debugging history, not for judging people.
10. Git Tag
Used for marking stable versions (v1.0.0, v2.3.1, etc.).
git tag v1.0.0
git push origin v1.0.0git tag v1.0.0
git push origin v1.0.0Important for releases, CI/CD pipelines, and rollbacks.
11. Git Diff
Shows what changed between commits, branches, or files.
git diff
git diff main..featuregit diff
git diff main..featureHelps understand what you're about to commit or merge.
12. Git Log (with formatting)
Default log is messy. Use aliases or flags:
git log --oneline --graph --decorate --allgit log --oneline --graph --decorate --allA visual summary of your repo.
13. Git Pull vs Git Fetch
Most developers mix these up.
fetch= get changes, do not mergepull= fetch + merge (or rebase)
git fetch
git pullgit fetch
git pullFetch gives you more control.
14. Git Ignore
Define which files Git should ignore (logs, temp files, IDE config, etc.)
Create .gitignore:
node_modules/
.env
*.lognode_modules/
.env
*.logReduces clutter and prevents secrets from being committed.
15. Git Hooks
Automate tasks before/after Git actions. Examples:
- prevent bad commit messages
- auto-run tests before pushing
- format code automatically
Hooks live in:
.git/hooks/.git/hooks/For example, a pre-commit formatter:
pre-commit → run eslint or prettierpre-commit → run eslint or prettierUsed heavily in professional teams.