This website requires JavaScript.
⚡️ Init & Config
git init
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --list
📦 Repository
git clone https://github.com/user/repo.git
git remote -v
git remote add origin https://github.com/user/repo.git
git fetch origin
📝 Commit & History
git status
git add file.txt
git add .                      # Add all changes
git commit -m "Message"
git log --oneline --graph
git show HEAD
git diff
🔄 Branching & Merging
git branch
git branch new-feature
git checkout new-feature
git switch main
git merge new-feature
git rebase main
git branch -d new-feature
🚦 Stash
git stash
git stash list
git stash apply
git stash drop
🗑️ Undo & Reset
git checkout -- file.txt           # Discard changes
git restore file.txt               # Discard changes (new)
git reset --hard HEAD              # Reset all changes
git revert <commit>
🌐 Push & Pull
git push origin main
git pull origin main
git fetch
🛡️ Tag
git tag v1.0.0
git tag
git push origin v1.0.0
🛠️ Misc
git blame file.txt
git shortlog -sn
git clean -fd
git rm file.txt
git mv
Docker
Golang