📚
dev

Git Cheat Sheet

Searchable Git command reference organized by category. Copy commands with one click. Covers basics, branching, remote, stash, and more.

git cheat sheetgit commandsgit referencegit guidegit tutorial

Developer quick reference

Interactive Git cheat sheet

Search common Git commands, filter by workflow category, and copy the command you need with one click.

Commands
18
Categories
6
Visible
18
Basics

git status

Show changed files, staged changes, and branch state.

Example
git status
Basics

git add .

Stage all current file changes.

Example
git add src/components
Basics

git commit -m "message"

Create a commit from staged changes.

Example
git commit -m "Add API tester tool"
Branching

git branch feature/api-tool

Create a new branch pointer.

Example
git branch feature/webhook-builder
Branching

git checkout -b feature/api-tool

Create and switch to a new branch in one step.

Example
git checkout -b feature/docker-generator
Branching

git merge main

Merge another branch into your current branch.

Example
git merge release
Remote

git remote -v

List configured remotes and URLs.

Example
git remote -v
Remote

git fetch origin

Download remote changes without merging.

Example
git fetch origin
Remote

git push -u origin feature/api-tool

Push a branch and set its upstream.

Example
git push -u origin feature/webhook-builder
Stash

git stash push -m "wip"

Save working changes without committing them.

Example
git stash push -m "cron builder draft"
Stash

git stash list

See saved stash entries.

Example
git stash list
Stash

git stash pop

Restore and remove the latest stash.

Example
git stash pop
Log

git log --oneline --graph --decorate

View compact commit history with branch context.

Example
git log --oneline --graph --decorate -10
Log

git diff --staged

Show what is staged for the next commit.

Example
git diff --staged
Log

git show HEAD~1

Inspect a previous commit in detail.

Example
git show HEAD~1
Undo

git restore file.txt

Discard unstaged changes in a file.

Example
git restore src/pages/tool/[slug].astro
Undo

git reset HEAD file.txt

Unstage a file but keep its changes.

Example
git reset HEAD src/data/tools.json
Undo

git revert <commit>

Create a new commit that reverses an older commit.

Example
git revert a1b2c3d

How to use

How to Use the Git Cheat Sheet

  1. 1 Search for commands by name or browse by category (basics, branching, remote, etc.).
  2. 2 Each command shows the syntax, description, and practical example.
  3. 3 Click any command to copy it to your clipboard for quick use in the terminal.

Git is the most widely used version control system. This reference covers everyday commands that developers use in their daily workflow.

Commands are organized from basic operations (init, add, commit) to advanced features (rebase, cherry-pick, bisect) for progressive learning.

More Dev tools

Related tools

You might also like