Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.
Git
Everyday version control - stage, commit, branch, sync, and undo.| Command | What it does | Example |
|---|---|---|
git init | Start a new repository in the current folder. | git init |
git clone | Copy a remote repository to your machine. | git clone https://github.com/torvalds/linux.git |
git status | Show what is staged, changed, and untracked. | git status |
git add | Stage changes for the next commit. | git add src/app.js |
git commit | Save the staged changes with a message. | git commit -m "Add login form" |
git commit -am | Stage all tracked files and commit in one step. | git commit -am "Fix header spacing" |
git log | Show commit history, compact and graphed. | git log --oneline --graph --all |
git diff | Show line-by-line unstaged changes. | git diff src/app.js |
git branch | List branches, or create a new one. | git branch feature-search |
git switch | Move to another branch. | git switch main |
git switch -c | Create a branch and switch to it. | git switch -c feature-search |
git merge | Merge another branch into the current one. | git merge feature-search |
git rebase | Replay your commits on top of another branch. | git rebase main |
git pull | Fetch and integrate changes from the remote. | git pull origin main |
git push | Send your commits to the remote. | git push origin main |
git stash | Shelve uncommitted changes to come back to. | git stash |
git stash pop | Reapply the most recently stashed changes. | git stash pop |
git reset --soft | Undo the last commit, keep changes staged. | git reset --soft HEAD~1 |
git restore | Discard changes to a file in the working tree. | git restore src/app.js |
git revert | Make a new commit that undoes an old one. | git revert 1a2b3c4 |
git remote -v | List the remotes and their URLs. | git remote -v |
git tag | Mark a commit with a version tag. | git tag -a v1.2.0 -m "Release 1.2.0" |