Git cheatsheet
Quick reference for Git commands and workflows
Git Cheatsheet
Common Git commands with descriptions
All
Configuration
Repository
Basic
Branching
Remote
History
Undoing
Stashing
Tags
Configuration
git config --global user.name "Name"git config --global user.email "email"git config --listRepository
git initgit clone <url>git statusBasic
git add .git add <file>git commit -m "message"git commit --amendgit diffgit diff --stagedBranching
git branchgit branch <name>git checkout <branch>git checkout -b <name>git merge <branch>git rebase <branch>git branch -d <name>Remote
git remote -vgit remote add origin <url>git fetch origingit pull origin <branch>git push origin <branch>git push -u origin <branch>History
git loggit log --onelinegit log --graph --onelinegit blame <file>Undoing
git reset HEAD <file>git checkout -- <file>git revert <commit>git reset --hard HEAD~1Stashing
git stashgit stash popgit stash listgit stash dropTags
git tag <name>git tag -a <name> -m "msg"git push origin --tags