Developer Cheatsheet Hub

Searchable quick-reference cheatsheets for Git, React Hooks, JavaScript, CSS, the terminal, and more.

Basics

8
Init repository
git init

Create a new local repository

Clone repository
git clone <url>

Clone a remote repository

Check status
git status

Show working tree status

Stage files
git add <file>

Add files to staging area

Stage all
git add .

Stage all changes

Commit
git commit -m "message"

Commit staged changes

View log
git log --oneline

Show commit history (compact)

Show diff
git diff

Show unstaged changes

Branches

9
List branches
git branch

List all local branches

Create branch
git branch <name>

Create a new branch

Switch branch
git checkout <name>

Switch to a branch

Create & switch
git checkout -b <name>

Create and switch to a new branch

Merge branch
git merge <branch>

Merge branch into current

Delete branch
git branch -d <name>

Delete a branch (safe)

Rebase
git rebase <branch>

Rebase current branch onto another

Switch branch
git switch <name>

Modern way to switch branches (Git 2.23+)

Create & switch
git switch -c <name>

Create and switch to a new branch (modern)

Remote

5
Add remote
git remote add origin <url>

Add a remote repository

Push
git push -u origin <branch>

Push branch and set upstream

Pull
git pull

Fetch and merge remote changes

Fetch
git fetch

Download remote changes without merging

List remotes
git remote -v

Show remote URLs

Undo & Fix

8
Unstage file
git reset HEAD <file>

Remove file from staging

Discard changes
git checkout -- <file>

Discard working directory changes

Amend commit
git commit --amend

Modify the last commit

Revert commit
git revert <hash>

Create a new commit that undoes changes

Stash changes
git stash

Temporarily save uncommitted changes

Apply stash
git stash pop

Restore stashed changes

Restore file
git restore <file>

Discard working directory changes (modern, replaces checkout --)

Unstage (modern)
git restore --staged <file>

Remove file from staging area (modern, replaces reset HEAD)

About this tool

Cheatsheet Hub

The Cheatsheet Hub is a searchable collection of quick-reference guides for the things developers look up most often: Git commands, React Hooks, JavaScript array methods, CSS Flexbox, Tailwind classes, terminal commands, and more.

Each cheatsheet is concise and example-driven so you can find the exact syntax in seconds instead of digging through documentation. It is free to browse.

Frequently asked questions

Cheatsheet Hub FAQ

What is a developer cheatsheet?
A cheatsheet is a condensed quick reference that collects the most-used commands, syntax, or methods for a topic in one place, so you can recall them fast without reading full documentation.
Which topics are covered?
Topics include Git, React Hooks, JavaScript arrays, CSS Flexbox, Tailwind CSS, terminal commands, and more, with new sheets added over time.
Can I search across the cheatsheets?
Yes. The hub is fully searchable, so you can jump straight to a command or method across every cheatsheet.
Are the cheatsheets free?
Yes. All cheatsheets in the hub are free to browse, no account required.