Hoja de referencia de comandos Git
Referencia interactiva de más de 80 comandos Git esenciales, organizados por categoría con búsqueda y favoritos.
Acerca de esta herramienta
Una referencia interactiva de Git que cubre más de 80 comandos de uso común organizados en categorías: Setup, Basic Workflow, Branching, Remote, Undo, Stash, Log/History y Advanced. Busque comandos por palabra clave, marque favoritos para acceso rápido y haga clic en cualquier comando para copiarlo o ver una explicación detallada.
Cómo usar
- 1 Paso 1: Explore los comandos por categoría usando la navegación por pestañas, o use el cuadro de búsqueda para encontrar un comando específico.
- 2 Paso 2: Haga clic en el botón de copia junto a cualquier comando para copiarlo directamente al portapapeles.
- 3 Paso 3: Haga clic en el icono de estrella para marcar comandos como favoritos — se guardarán y serán accesibles mediante la pestaña Favorites.
- 4 Paso 4: Active el modo 'Explain' y haga clic en cualquier comando para ver una explicación detallada con ejemplos y casos de uso.
A searchable reference for the commands you keep forgetting
Git has hundreds of commands and flags, but most daily work draws on a few dozen. The trouble is remembering the exact syntax under pressure — the difference between reset --soft and reset --hard, or how to safely undo a push. This cheat sheet collects the commands that matter, organised into the categories you actually think in: Setup, Basic Workflow, Branching, Remote, Undo, Stash, Log/History, and Advanced. Each entry shows the command, a one-line description, and a real example you can copy with a single click.
How to use it: tabs, search, and Explain mode
Three controls make this faster than scrolling a long list. Category tabs jump straight to a group — click "Branching" to see only branch commands. Search matches across both command text and descriptions at once, so typing undo surfaces relevant commands even though the word "undo" is in the description, not the command. And Explain mode is the key feature: tick it, then click any command to expand a paragraph describing what it really does, with its own worked example. That turns the sheet from a list of strings into something that teaches the why, not just the what.
Favorites that persist
Every command has a star. Click it and the command is added to a Favorites tab, and that list is saved in your browser's local storage — so the handful of commands you reach for daily are still there the next time you open the page. There is no account and no sync; the favorites live on your device. The Copy button next to each command puts just the command text on your clipboard and flashes a brief "Copied!" confirmation.
A worked example: undoing your last commit
Suppose you committed too early. Open the Undo tab and you will see three resets that look almost identical but behave very differently — this is exactly where people get burned:
| Command | Moves HEAD back? | Your changes |
|---|---|---|
git reset --soft HEAD~1 | Yes | Kept, still staged |
git reset --mixed HEAD~1 | Yes | Kept, unstaged |
git reset --hard HEAD~1 | Yes | Discarded permanently |
Turn on Explain mode and click git reset --hard HEAD~1: it warns that the change "cannot be undone easily." For undoing a commit you have already pushed, the sheet points you instead to git revert, which creates a new commit that reverses the old one — safe for shared branches because it rewrites no history.
The safety distinctions worth internalising
--forceversus--force-with-lease. A plain force push can clobber a teammate's work.git push --force-with-leaseonly succeeds if nobody has pushed since your last fetch — the sheet recommends it for exactly this reason.- Reset versus revert. Reset moves history and is fine on local, unpushed commits; revert adds an undo commit and is the right tool once others have your commits.
- Merge versus rebase. Merge preserves the branch shape with a merge commit; rebase replays your commits for a linear history. The sheet lists both with notes on when each fits.
git reflogis your safety net. If a reset loses a commit, reflog shows where HEAD pointed recently so you can recover it — one of the most reassuring commands to know exists.
Beyond the basics
The Advanced tab covers the commands that feel like magic once you meet them: git cherry-pick to lift a single commit onto another branch, git rebase -i to squash and reorder commits before a merge, git bisect to binary-search history for the commit that introduced a bug, and git worktree to check out two branches in two folders at once. The Stash tab covers saving half-finished work out of the way, and Log/History covers reading the past — git log --oneline --graph --all for a visual branch map, git blame to find who last touched a line.
Common mistakes this sheet helps you avoid
- Reaching for
--hardwhen you meant--soft. Read the Explain text before running a reset you cannot undo. - Using
commit -amand expecting new files to be included. The note makes clear it only stages already-tracked files, not new untracked ones. - Amending or force-pushing shared branches. The entries flag which commands rewrite history and should stay on your local work.
Everything runs in your browser. There is no Git execution here and nothing is sent anywhere — it is a fast, private, copy-ready reference that remembers your favorites between visits.