Git Command Cheat Sheet

Quick reference for common Git commands — searchable by category

Setup & Basics

git initInitialize a new repository
git clone <url>Clone a remote repository
git config --global user.name "Name"Set global username
git config --global user.email "email"Set global email

Staging & Committing

git statusShow working tree status
git add <file>Stage a file
git add .Stage all changes
git commit -m "message"Commit staged changes
git commit --amendAmend last commit

Branching & Merging

git branchList branches
git branch <name>Create a branch
git checkout <branch>Switch to branch
git checkout -b <branch>Create and switch to branch
git merge <branch>Merge branch into current
git branch -d <branch>Delete a branch

Remote & Push/Pull

git remote -vList remotes
git push origin <branch>Push to remote
git pullFetch and merge from remote
git fetchFetch from remote (no merge)

Log & History

git logShow commit history
git log --onelineCompact commit history
git diffShow unstaged changes
git stashStash current changes
git stash popApply stashed changes

About This Tool

The Git Command Cheat Sheet is a quick searchable reference for the most common Git commands, organized by category. Browse Setup, Staging, Branching, Remote, and Log commands — or search by keyword to find exactly what you need.

How to Use

  1. Use the Search Commands field to filter by keyword (e.g., "commit", "branch", "push").
  2. Browse commands by category: Setup, Staging, Branching, Remote, and Log.
  3. Click any command to copy it to your clipboard.
  4. Use the categories to explore commands you may not know yet.

Why Choose OmniTools?

⚡ Instant Results

Zero server lag. All calculations run locally on your device for maximum speed.

🛡️ 100% Private

Your data never leaves your device. No uploads, no servers, no tracking.

Frequently Asked Questions

What Git version is this for?

These commands work with Git 2.x and above, which covers the vast majority of modern Git installations.

How do I undo the last commit?

Use git reset --soft HEAD~1 to undo the last commit while keeping changes staged, or git reset --hard HEAD~1 to discard changes entirely.

What's the difference between fetch and pull?

git fetch downloads changes from the remote but doesn't merge them. git pull fetches and immediately merges into your current branch.

Is this tool free?

Yes, completely free with no sign-up required.

Related Tools