Repository Basics
git init
git clone <repo-url>
Staging & Commit
git add .
git commit -m \"message\"
Branches
git branch
git switch -c feature
git merge feature
Remote & Sync
git remote -v
git remote add origin <url>
git remote set-url origin <new-url>
git push origin main
git pull
History
git log --oneline --graph --decorate --all
git reset --hard HEAD~1
git revert <commit>