Skip to content
DevToolKit

Interactive Git Cheatsheet

Master Git with our interactive visual cheatsheet. Learn commands through flow diagrams, build custom snippets with flags, and find emergency recovery tips.

Interactive Flow

Click a zone to filter related commands

Recovery Scenarios

13 Commands Found

git addbasic

Add file contents to the staging area (index).

git add .
git commitbasic

Record changes to the repository.

git commit -m "initial commit"
git statusbasic

Show the working tree status.

git status
git checkoutbranching

Switch branches or restore working tree files.

git checkout
git switchbranching

Switch branches.

git switch
git mergebranching

Join two or more development histories together.

git merge
git pushremote

Update remote refs along with associated objects.

git push
git fetchremote

Download objects and refs from another repository.

git fetch
git pullremote

Fetch from and integrate with another repository or a local branch.

git pull
git resetrecovery

Undo commits, keep changes in staging.

git reset --soft HEAD~1
git resetrecovery

Discard ALL changes and commits (DANGER).

git reset --hard HEAD~1
git stashadvanced

Stash the changes in a dirty working directory away.

git stash
git rebaseadvanced

Reapply commits on top of another base tip.

git rebase
Was this tool helpful?

How to Use

The Interactive Git Cheatsheet is a modern visual reference for developers of all skill levels. Use it to understand how Git manages your code and to quickly build correctly formatted commands.

How to use this tool

  1. Visual Zone Filtering: Click on one of the four areas (Workspace, Staging, Local Repo, or Remote) in the top flow map to see only the commands that interact with that zone.
  2. Interactive Command Builder: Every command card features a real-time terminal block. Toggle flags like --amend or --force to see the command string update instantly.
  3. Search & Categorize: Use the sidebar to filter by category (Basics, Branching, etc.) or use the search bar to find commands by keyword.
  4. One-Click Copy: Once you've configured your command with the desired flags, click the copy icon to grab the snippet for your terminal.
  5. Emergency Recovery: Check the "Recovery Scenarios" in the sidebar for quick solutions to common Git mistakes.

About This Tool

The 4 Areas of Git

Understanding Git becomes much easier when you visualize it as data moving between four distinct environments:

  • Workspace: Your local file system where you edit code.
  • Staging (Index): A temporary area where you prepare changes for the next commit.
  • Local Repo: The .git directory on your machine containing your full commit history.
  • Remote Repo: A shared version of the repository hosted on a server (like GitHub or GitLab).

Why Use This Tool

Why an Interactive Cheatsheet?

Static PDF cheatsheets are great for printing but fail to show the **dynamic nature** of Git. This tool bridges the gap by providing a functional CLI builder and a visual mental model. By interacting with the flow map, you develop an intuitive understanding of *where* your code is at any given step, reducing the risk of accidental data loss or "merge hell."

FAQ

What are the most important Git commands to learn first?
The essential commands are: git init (create repository), git clone (copy repository), git add (stage changes), git commit (save changes), git push (upload to remote), git pull (download from remote), git branch (manage branches), and git merge (merge branches). These cover most project workflows.
How does the command builder work?
The builder lets you select a base command and interactively add flags and options. Each flag is explained with its effect. The final command is built in real time and can be copied directly for use in the terminal.
What are the emergency recovery tips?
These are solutions for critical situations such as: undoing the last commit, recovering deleted files, resolving merge conflicts, recovering deleted branches with git reflog, and cleaning up history. Each solution includes exact commands with explanations.
Do I need an internet connection to use the cheatsheet?
No. All content is loaded with the page. Once opened, you can disconnect from the internet and continue browsing all commands, diagrams, and examples.