git initInitialize repository
git clone <url>Clone repository
git statusShow working tree status
git add <file>Stage file
git add .Stage all changes
git add -p <file>Stage parts of file
git restore --staged <file>Unstage file
git commit -m "msg"Commit staged changes
git commit --amendEdit last commit
git logShow commit history
git log --onelineCompact history
git diffShow unstaged changes
git diff --stagedShow staged changes
git branchList branches
git branch <name>Create branch
git switch <branch>Switch branch
git checkout -b <name>Create and switch branch
git merge <branch>Merge branch
git rebase <branch>Rebase onto branch
git remote -vList remotes
git remote add origin <url>Add remote
git push -u origin <branch>Push and set upstream
git pullFetch and merge
git fetchFetch from remote
git stashStash changes
git stash popApply and remove stash
git stash listList stashes
git reset HEAD~1Undo last commit
git reset --hard HEADDiscard all changes
git revert <commit>Revert commit
git cherry-pick <commit>Apply commit
git clean -fdRemove untracked files
git reflogShow reference history
git blame <file>Show line annotations
git show <commit>Show commit details
git tag <name>Create tag
git push origin --tagsPush tags
git bisect startStart binary search