A complete, organized manual for navigating the Git world — from absolute beginner to advanced techniques. Each topic has its own focused guide. Pick what you need!
Cheers to coding! 🚀
git-commands-reference/
├── README.md ← You are here (start here!)
└── docs/
├── 01-getting-started.md
├── 02-complete-workflow.md
├── 03-branching.md
├── 04-merging-conflicts.md
├── 05-remote-repository.md
├── 06-undoing-fixing.md
├── 07-investigation.md
├── 08-stashing.md
├── 09-advanced-techniques.md
├── 10-configuration.md
├── 11-emergency.md
├── 12-pro-tips.md
├── 13-partial-staging.md ← 🆕
├── 14-ssh-setup.md ← 🆕
└── 15-github-workflow.md ← 🆕
| # | Topic | What You'll Learn |
|---|---|---|
| 1 | Getting Started | Install Git, git init, how Git tracks files |
| 2 | The Complete Workflow | Init → add → commit → push, first-time setup |
| 14 | SSH Key Setup 🆕 | Connect to GitHub securely without passwords |
| # | Topic | What You'll Learn |
|---|---|---|
| 3 | Mastering Branches | Create, switch, rename, delete branches |
| 4 | Merge Strategies & Conflict Resolution | --no-ff, --squash, resolving conflicts |
| 5 | Remote Repository Mastery | fetch, pull, push, managing remotes |
| 6 | Time Travel: Undoing & Fixing | reset, revert, restore, clean up mistakes |
| 7 | Investigation & Information | git log, git diff, git blame, git show |
| 8 | Stashing & Temporary Storage | Save/restore work-in-progress instantly |
| 13 | Partial Staging (git add -p) 🆕 |
Stage only selected lines — like a pro! |
| # | Topic | What You'll Learn |
|---|---|---|
| 9 | Advanced Git Techniques | Rebase, cherry-pick, bisect, tags |
| 10 | Configuration & Customization | Aliases, global settings, .gitignore |
| 11 | Emergency Git Commands | reflog, recover lost commits, detached HEAD |
| 15 | GitHub Forking Workflow 🆕 | Fork, open PRs, sync with upstream |
| # | Topic | What You'll Learn |
|---|---|---|
| 12 | Pro Tips & Best Practices | Commit conventions, workflows, safety rules |
| Task | Command |
|---|---|
| Check status | git status |
| Stage all changes | git add . |
| Stage selectively | git add -p |
| Commit | git commit -m "type: message" |
| Push | git push |
| Pull updates | git pull |
| Create & switch branch | git checkout -b feature/name |
| Merge a branch | git merge feature/name |
| Delete branch | git branch -d feature/name |
| Stash work | git stash |
| Restore stash | git stash pop |
| Undo last commit (keep files) | git reset --soft HEAD~1 |
| Safe undo (public repos) | git revert HEAD |
| Find lost commits | git reflog |
| Stage specific lines | git add -p filename |
| Visual commit graph | git log --oneline --graph --all |
| Who changed this line? | git blame filename |
- Commit early, commit often 📝
- Write descriptive commit messages 💬
- Always pull before push ⬇️⬆️
- Use branches for every feature 🌿
- Test before you commit ✅
- Never force push to shared branches 🛡️
- Use
--force-with-leaseinstead of--force⚠️ - When in doubt,
git reflogcan save you 🚨
- Official Git Documentation
- Pro Git Book (Free)
- Interactive Git Learning
- Git Cheat Sheet
- Conventional Commits Spec
Happy Git-ing! May your merges be conflict-free and your commits be meaningful! 🚀✨
"With great Git power comes great Git responsibility!" — Uncle Git 🕷️
⭐ This is a living document. Contributions welcome!
Made with ❤️ for developers who want to Git things done right!