Skip to main content
FreeOnlineTools Go
English

Git Cheatsheet

Comprehensive Git command cheatsheet with common operations, branching, merging, stashing, and troubleshooting. Free, private, browser-based.

Local processing

Setup & Config

git config --global user.name "Name"Set global username
git config --global user.email "email"Set global email
git config --listShow all config
git config --global core.editor vimSet default editor
git config --global alias.co checkoutCreate alias

Basics

git initInitialize new repo
git clone <url>Clone a repo
git statusShow working tree status
git add <file>Stage file
git add .Stage all changes
git commit -m "msg"Commit staged changes
git commit -am "msg"Stage tracked + commit
git push origin mainPush to remote
git pullFetch + merge
git fetchFetch without merge

Branching

git branchList branches
git branch <name>Create branch
git checkout <branch>Switch branch
git checkout -b <name>Create + switch
git branch -d <name>Delete branch
git branch -D <name>Force delete branch
git branch -m <new>Rename current branch
git push -u origin <branch>Push new branch upstream

Merging & Rebasing

git merge <branch>Merge branch into current
git merge --no-ff <branch>Force merge commit
git rebase <branch>Rebase onto branch
git rebase -i HEAD~3Interactive rebase last 3
git rebase --abortCancel rebase
git rebase --continueContinue after conflict
git cherry-pick <commit>Apply specific commit

Inspecting

git logShow commit history
git log --oneline --graphCompact graph log
git log -pLog with diffs
git diffShow unstaged changes
git diff --stagedShow staged changes
git show <commit>Show commit details
git blame <file>Show who changed each line

Stashing

git stashStash changes
git stash save "msg"Stash with message
git stash listList stashes
git stash popApply + drop latest stash
git stash applyApply latest stash
git stash dropDrop latest stash
git stash clearDrop all stashes

Undo & Fix

git reset HEAD <file>Unstage file
git reset --soft HEAD~1Undo last commit, keep changes
git reset --hard HEAD~1Undo last commit, discard changes
git revert <commit>Create undo commit
git checkout -- <file>Discard file changes
git clean -fdRemove untracked files/dirs
git reflogShow reference log
git bisect startStart binary search for bug

Remote

git remote -vList remotes
git remote add origin <url>Add remote
git remote set-url origin <url>Change remote URL
git push --force-with-leaseSafe force push
git fetch --pruneFetch + remove deleted branches

What is Git Cheatsheet?

Git is a distributed version control system. This cheatsheet provides a quick reference for the most common Git commands organized by category: setup, basics, branching, merging, inspecting, stashing, and troubleshooting.

How It Works

The tool displays a searchable, categorized list of Git commands with descriptions. A filter input narrows results by command or description text.

Common Use Cases

  • Quick lookup of Git commands
  • Learning Git workflow
  • Troubleshooting Git issues

Technical Details

Static reference data rendered as a searchable table. All filtering is client-side. No network requests.

How to Use

  1. Browse commands by category
  2. Use the filter box to search
  3. Copy any command with the copy button

Privacy

All processing happens in your browser. Your data is never uploaded to any server.

FAQ

Does this cover advanced Git commands?

Yes. It includes basic operations, branching, merging, rebasing, stashing, reflog, cherry-pick, bisect, and common troubleshooting scenarios.

Can I search for specific commands?

Yes. Use the filter box to search across all commands and descriptions.

Related Tools