PicExtractor
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 folder
  • git clone <url>Copy a remote repository locally
  • git add . / -pStage everything / interactively choose hunks
  • git commit -m "msg"Save a snapshot with a message
  • git status / git diffSee what changed and what's staged

Branches

  • git switch -c feat/xCreate and switch to a new branch
  • git branch -d <name>Delete a merged branch
  • git merge <branch>Merge another branch into the current one
  • git rebase mainMove your branch on top of latest main
  • git log --oneline --graphPretty one-line history with branches

Undo & Remote

  • git restore <file>Discard local changes to a file
  • git reset --soft HEAD~1Undo last commit, keep changes staged
  • git revert <hash>Safely undo a pushed commit with a new commit
  • git push -u origin <branch>Push a new branch and set upstream
  • git pull --rebaseFetch remote and replay your work on top