Developer Cheatsheets
Quick-reference cards for Git, Docker, Linux, SQL, Vim, and Regex.
Setup
git config --global user.name 'Name'Set global usernamegit config --global user.email 'email'Set global emailgit initInitialize a new repositorygit clone <url>Clone a remote repositoryStaging & Commits
git add .Stage all changesgit add <file>Stage specific filegit commit -m 'message'Commit with messagegit commit --amendModify the last commitgit statusShow working tree statusgit diffShow unstaged changesBranching
git branchList all branchesgit branch <name>Create a new branchgit checkout -b <name>Create and switch to branchgit switch <name>Switch to a branchgit merge <branch>Merge branch into currentgit rebase <branch>Rebase current onto branchgit branch -d <name>Delete a branchRemote
git push origin <branch>Push to remotegit pullFetch and merge from remotegit fetchFetch from remotegit remote -vList remotesgit remote add origin <url>Add remote originUndo
git reset --soft HEAD~1Undo last commit (keep staged)git reset HEAD~1Undo last commit (unstage)git reset --hard HEAD~1Undo last commit (discard changes)git stashStash current changesgit stash popApply and remove last stashgit revert <hash>Create a revert commit