Quick Reference - Git Workflow
November 7, 2025 ยท View on GitHub
Branching Strategy: Git Flow (dev โ main)
๐ Start New Feature
git checkout dev && git pull origin dev
git checkout -b feat/your-feature-name
๐พ Commit Changes
git add .
git commit -m "feat: your change
Details here.
๐ค Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
Commit types: feat, fix, docs, chore, test, ci, perf, style, refactor, revert
๐ค Create PR to dev
git push -u origin feat/your-feature-name
gh pr create --base dev --head feat/your-feature-name \
--title "feat: your feature" \
--body "## Summary
Your description here"
โ Merge PR
# Via CLI
gh pr merge <PR-NUMBER> --squash --delete-branch
# Via GitHub UI (recommended)
# Click "Squash and merge"
# Branch auto-deletes
๐ Release to main
git checkout dev && git pull origin dev
gh pr create --base main --head dev \
--title "chore(release): v1.2.3" \
--body "## Release Summary
Changes included..."
# After merge
git checkout main && git pull origin main
git tag -a v1.2.3 -m "Release 1.2.3"
git push origin v1.2.3
๐ฅ Hotfix (Emergency)
git checkout main && git pull origin main
git checkout -b hotfix/critical-fix
# Make fix
git add . && git commit -m "fix: critical issue"
gh pr create --base main --head hotfix/critical-fix \
--title "[HOTFIX] fix: critical issue"
# After merge to main, backport to dev
git checkout dev && git merge main && git push origin dev
๐ Branch Naming
feat/- New featuresfix/- Bug fixesdocs/- Documentationchore/- Maintenancetest/- Testsci/- CI/CD changeshotfix/- Emergency fixes
๐ก๏ธ Branch Protection
main (production)
- โ Require PR
- โ Require checks: CI Quality Gate, Security Audit
- โ Require conversation resolution
- โ No direct pushes
dev (integration)
- โ Require PR
- โ Require checks: CI Quality Gate, Security Audit
- โ Require conversation resolution
- โ ๏ธ Force push allowed (for cleanup)
๐ Troubleshooting
Can't push to dev/main? โ Create PR, protected branches don't allow direct pushes
Checks failing? โ Wait for CI to pass or fix issues
Branch diverged?
git checkout dev && git pull origin dev
git checkout your-branch && git merge dev
git push origin your-branch --force-with-lease
Full Guide: BRANCHING-STRATEGY.md