Skip to main content
DeveloperProcessado no seu navegador

Git Cheatsheet

Interactive visual reference for essential Git commands.

0 of 3 uses today · 3 remaining. Go Pro and remove the limit.

Upgrade
Track
3 scenarios
Commands
17
Caution
0 high
Recovery
Assisted
01

Filter by scenario

Search track
Presets

Start repository

Create repo, prepare base branch, and connect remote without friction.
basic
git initlow
Initializes the repository in the current folder.
git add .low
Moves initial files to staging.
git commit -m "chore: init"low
Creates the first baseline commit.
git branch -M mainlow
Standardizes the main branch before push.
git remote add origin <url>low
Connects the main remote repository.
git remote add origin https://github.com/org/repo.git
git push -u origin mainlow
Publishes the base branch and sets upstream.

Feature flow

Open working branch, update base, and integrate back with clarity.
basic
git switch -c feature/<tema>low
Creates and switches to the feature branch.
git switch -c feature/login
git add .low
Updates staging with current progress.
git commit -m "feat: ..."low
Records a work step with context.
git fetch originlow
Updates remote references before integration.
git switch mainlow
Returns to the integration base.
git merge feature/<tema>medium
Integrates the feature branch into the base.

Safe undo

Choose between restore, reset, and revert without accidentally destroying work.
basic
git restore <arquivo>medium
Discards uncommitted local change in a file.
git restore src/app/page.tsx
git restore --staged <arquivo>low
Removes file from staging without losing local edit.
git reset --soft HEAD~1medium
Goes back one commit keeping everything in staging.
git reset --mixed HEAD~1medium
Goes back one commit and returns changes to working tree.
git revert <hash>low
Creates a safe inverse commit for shared history.
02

Quick decision

Undo
Use restore for local files, revert for shared history, and reflog before aggressive reset.
Integration
Prefer merge when you want to preserve branching and rebase when you want to linearize before final merge.
Scale
Use worktree for parallel branches and sparse-checkout when the monorepo is too large for the current task.
03

Export

Recovery and selective delivery
Rebase with exit route, reflog for rescue, and cherry-pick for hotfix or backport without full merge.
Exportable runbook
Export the filtered track to CSV for technical inventory or TXT for shareable squad playbook.
04

Operational view

Clean
Low
13
Medium
4
High
0
Placeholders like <tema>, <arquivo>, <hash>, and <url> must be replaced before execution.

§ How to use

How to find a Git command fast

Quick search for Git commands by situation ('undo a commit', 'revert a merge', 'create a branch') with examples.

  1. Type what you need

    Use natural language ('I want to undo the last commit'). Semantic search finds it even if you don't know the command name.

  2. See the command + explanation

    Each result has the exact command, what it does, when to use it and equivalent alternatives.

  3. Copy and adapt

    Replace placeholders ([branch], [hash]) with your values. Take special care with destructive commands (--force, reset --hard).

Related

Related tools

Da mesma categoria.