Welcome to the Ultimate Git Reference Guide!
This repository is a simple and practical collection of Git commands, workflows, and best practices.
It is designed to help developers quickly understand and use Git in real projects — including commits, branches, merges, configuration, and more.
It is still in progress — more commands and sections will be added soon.
- Git Structure — Understand the Working Directory, Staging Area, and Local/Remote repositories.
- Git Definitions — Key Git terms explained: commit, branch, merge, rebase, stash, HEAD, and more.
- Configuration Levels — Learn the priority of System, Global, and Local configurations.
- Configuration Commands — View, set, unset settings, and create custom aliases.
- Add Commit — Stage all files, specific files, or partial changes and commit.
- Rename Commit — Amend the last commit or rewrite older/root commits using interactive rebase.
- Delete Commit — Remove commits using soft, mixed, or hard reset, with rules for pushed vs non-pushed commits.
- Add & Rename Branches — Create, switch, list, and safely rename branches locally and remotely.
- Deleting & Recovering — Delete local or remote branches, prune stale branches, and recover lost branches using reflog.
- Merge Branch — Local and Pull Request merges, fast-forward vs squash merges, resolving conflicts, and aborting merges.
- Navigate to the section you need using the links above.
- Follow the step-by-step commands and notes.
- Use summary tables for quick reference if you’re in a hurry.
- Check examples in each file for real-world Git workflows.
This README is your starting point to explore all Git commands and best practices in this repository.