Git Commands Every Developer Should Know
📖 Bu rehber ToolPazar ekibi tarafından hazırlanmıştır. Tüm araçlarımız ücretsiz ve reklamsızdır.
Daily-use commands
This guide covers the commands that actually matter day-to-day, organized by what you’re trying to do — plus the “oh no” recovery commands that every engineer needs at some point.
Branching
Basic commit. Write clear messages — imperative mood (“Add” not “Added”), brief first line, blank line, then detail if needed.
Syncing
Edit the most recent commit. Great for typo fixes or adding a forgotten file. Don’t amend commits you’ve already pushed to shared branches — it rewrites history.
History and rewriting
List branches with their tracking branch and how far ahead/behind. Useful when multiple feature branches are in flight.
Recovery (the “oh no” commands)
Interactive rebase — the cleanup tool. Reorder, squash, edit, or reword the last N commits before pushing. Essential for turning messy WIP commits into a clean PR history.
Bonus: config that makes your life easier
Apply a specific commit from another branch. Great when you need one fix from a feature branch without the rest.