Git cheat sheets

Git is the version control system behind nearly every project on GitHub, GitLab and the workplace, and its hardest 10% — undoing, recovering, branching — is where most searches start. These three sheets keep the parts you actually type in front of you. Everyday commands covers the loop you run fifty times a day: status, add, commit, push, pull, log and diff. Undo & recover is the safety net — reset, revert, amend, stash and the reflog that bails you out. Branching & merging covers branch, switch, merge, rebase and cherry-pick.

Every command is verified against the official Git documentation and behaves identically on Windows, macOS and Linux — Git has no platform-specific flag differences for the commands below. Two ideas run through all three sheets: Git stages changes before committing (the three-tree model), and almost nothing is ever truly lost — the reflog keeps every move for ~90 days. Start with basics, then keep undo open in a tab forever.

Cheat sheets

Network tools

Subnet CalculatorIPv6 CalculatorWildcard MaskRange → CIDRSplitterAggregatorVLSM CalculatorPracticeCheat Sheet

FAQ

What is Git?

Git is a free, distributed version control system that records snapshots of your files over time so you can track changes, branch, merge and roll back. It was created by Linus Torvalds for Linux kernel development and is the engine behind GitHub, GitLab and most modern software teams. Being distributed means every clone contains the full history, so work continues offline and nothing depends on a single server.

What is the difference between Git and GitHub?

Git is the version control tool that runs on your machine. GitHub (and GitLab, Bitbucket) is a hosted service that stores Git repositories in the cloud and adds collaboration features — pull requests, issues, code review and CI. You use Git locally and push to a hosting service to share work.

What are the three trees in Git?

Git tracks three states: the working tree (your files on disk), the index or staging area (what will go into the next commit), and HEAD (the latest commit). git add moves changes from the working tree to the index, and git commit records the index as a new commit. Understanding this explains reset's --soft, --mixed and --hard flags.

How is this cheat sheet different from the official Git documentation?

The official docs are the definitive reference, but they are written for completeness, not for 'what do I type when I just broke something'. These sheets are the distilled, task-oriented subset — the daily loop, the undo paths and the branching verbs — and every row links back to the official page it came from so you can go deeper.