Developer reference · Always free
Cheat Sheets
The commands and patterns you keep googling — on one page, searchable.
Everyday Git commands — from first commit to undoing mistakes.
Start & Save
git initStart a new repository in the current foldergit clone <url>Copy a remote repository locallygit add . / -pStage everything / interactively choose hunksgit commit -m "msg"Save a snapshot with a messagegit status / git diffSee what changed and what's staged
Branches
git switch -c feat/xCreate and switch to a new branchgit branch -d <name>Delete a merged branchgit merge <branch>Merge another branch into the current onegit rebase mainMove your branch on top of latest maingit log --oneline --graphPretty one-line history with branches
Undo & Remote
git restore <file>Discard local changes to a filegit reset --soft HEAD~1Undo last commit, keep changes stagedgit revert <hash>Safely undo a pushed commit with a new commitgit push -u origin <branch>Push a new branch and set upstreamgit pull --rebaseFetch remote and replay your work on top