← Cheatsheets
CI/CD
git
Essential git commands for daily version control. Branching, syncing, undoing mistakes and managing history.
Setup & Config
git config --global user.name "Name"git config --global user.email "email"git config --listgit initgit clone <url>git clone <url> --depth=1Basic Workflow
git statusgit add <file>git add .git add -pgit commit -m "message"git commit --amendgit diffgit diff --stagedBranching
git branchgit branch -agit switch <name>git switch -c <name>git merge <branch>git rebase <branch>git branch -d <name>git branch -D <name>Remote & Sync
git remote -vgit remote add origin <url>git fetchgit pullgit pull --rebasegit push origin <branch>git push -u origin <branch>git push --force-with-leaseHistory
git log --onelinegit log --oneline --graph --allgit log -pgit log --author="name"git show <hash>git blame <file>Undo & Reset
git restore <file>git restore --staged <file>git revert <hash>git reset --soft HEAD~1git reset --mixed HEAD~1git reset --hard HEAD~1git clean -fdStash
git stashgit stash push -m "message"git stash listgit stash popgit stash apply stash@{n}git stash drop stash@{n}git stash clear