Git Command Reference
Searchable Git cheatsheet covering daily commands, rebasing, stashing and undo recipes.
Create a new local Git repository in the current directory.
git initDownload a full repository with history and remote tracking.
git clone <url>Show concise current branch, staged, and unstaged file states.
git status -sbReview and selectively stage changes hunk by hunk before committing.
git add -pRecord staged snapshot with a concise commit subject.
git commit -m "<message>"Display recent commits, branch pointers, and merge topology.
git log --oneline --graph --decorate -n 20Preview exact lines included in the next commit.
git diff --stagedFind which commit last modified each line while ignoring whitespace.
git blame -w -C <file>Create a new branch from HEAD and check it out immediately.
git switch -c <branch>Safely remove a branch that is already merged upstream.
git branch -d <branch>Add staged fixes to the previous commit without changing its message.
git commit --amend --no-editReorder, squash, or reword the last 3 local commits before pushing.
git rebase -i HEAD~3Replay local commits cleanly on top of upstream changes.
git pull --rebasePublish local branch and configure tracking with origin.
git push -u origin <branch>Temporarily shelve dirty edits including new untracked files.
git stash push -u -m "<note>"Re-apply and drop the most recent stashed work.
git stash popReset working-tree changes back to the staged/HEAD snapshot.
git restore <file>Move HEAD back one commit while keeping edits ready to re-commit.
git reset --soft HEAD~1Create a new inverse commit without rewriting shared history.
git revert <sha>Create a signed/annotated release marker and push with git push --tags.
git tag -a v1.0.0 -m "Release v1.0.0"Locate the exact commit that introduced a bug using binary search.
git bisect start HEAD <good-sha>Check out another branch simultaneously in a sibling folder.
git worktree add ../wt-hotfix <branch>Your input is processed locally in this browser tab.
How to use Git Command Reference
Type keywords (such as rebase, stash, restore, bisect, or worktree) in the search box.
Filter by workflow category chips like Everyday, Branches, Rewrite, or Undo.
Click Copy on any command to grab it cleanly for your terminal.
Frequently asked questions
Are safe undo workflows included for pushed vs local commits?
Yes. Undo commands distinguish git reset --soft (local) from git revert (already pushed history).
Does the reference work offline?
Yes. Every command snippet and explanation is bundled statically.