Git & GitHub Cheatsheet
Configuration
git config --global user.name 'Your Name'
git config --global user.email '[email protected]'
git config --list
Create Repository
git init
git clone
Basic Snapshotting
git status
git add
git add .
git commit -m 'commit message'
git commit -am 'commit message'
Branching & Merging
git branch
git branch
git checkout
git checkout -b
git merge
git branch -d
Remote Repositories
git remote -v
git remote add origin
git push -u origin
git push
git pull
git fetch
Undoing Changes
git checkout --
git reset HEAD
git reset --hard
git revert
Stashing
git stash
git stash list
git stash apply
git stash drop
Logs & History
git log
git log --oneline --graph --decorate --all
git show
git diff
git diff --staged
Tagging
git tag
git tag
git tag -a -m 'message'
git push origin
git push origin --tags
GitHub Specific
Fork repository on GitHub
Create Pull Request (PR)
Review & Merge PR
GitHub Actions for CI/CD