Skip to content
Guest
← All References
Git Git 2.40+ / GitHub

Git & GitHub Quick Reference

Essential Git commands for staging, committing, branching, merging, syncing remotes, and safely undoing changes.

git checkout -b feat && git add . && git commit -m 'msg'

Daily Snapshot Commands

CommandPurposeExample
git initInitialize a new Git repositorygit init
git statusShow branch, staged, and unstaged filesgit status
git addStage files for the next commitgit add . or git add app.js
git commit -mRecord a snapshot with a messagegit commit -m "Add auth guard"
git log --onelineCompact commit historygit log --oneline -n 10

Branching, Remotes & Undo

CommandPurposeExample
git checkout -bCreate and switch to a branchgit checkout -b feat/search
git mergeMerge a branch into current branchgit merge feat/search
git fetch / git pullDownload remote updates / download + mergegit fetch origin
git push -u originPublish branch and track upstreamgit push -u origin feat/search
git stash / popShelve and restore uncommitted editsgit stash && git stash pop
git revert <hash>Safely undo a pushed commitgit revert a1b2c3d

Search courses, lessons, and references

Type to search across all courses, lessons, and quick references.

Press Esc to close Powered by Pagefind