Git Workflow
GitHub Flow with develop branch for integration.
Branch Strategy
main (production)
↑ PR (release)
develop (integration)
↑ PR (feature complete)
feature/xxx (work)
Branch Naming
| Type | Pattern | Example |
|---|---|---|
| Feature | feature/t-xxx-description |
feature/t-001-add-auth |
| Fix | fix/t-xxx-description |
fix/t-015-login-bug |
| Hotfix | hotfix/xxx |
hotfix/critical-security |
| Release | release/vX.Y.Z |
release/v2.1.0 |
Daily Workflow
Start Work
# Update develop
git checkout develop
git pull origin develop
# Create feature branch
git checkout -b feature/t-001-description
During Work
# Stage changes
git add <specific-files>
# Commit (conventional format)
git commit -m "feat(scope): description"
# Push (CI-Local validates first)
git push -u origin feature/t-001-description
Create PR
gh pr create --base develop --title "feat: T-001 description" --body "
## Summary
- What this PR does
## Test Plan
- How to test
## Related
- Closes #123
"
After Review
# Merge PR (squash recommended)
gh pr merge <number> --squash
# Delete local branch
git checkout develop
git branch -d feature/t-001-description
Commit Convention
Format: type(scope): description
Types
| Type | Use |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code change (no feature/fix) |
docs |
Documentation only |
test |
Tests only |
chore |
Maintenance |
style |
Formatting |
perf |
Performance |
Examples
feat(auth): add JWT token refresh
fix(api): handle null response
refactor(core): simplify validation logic
docs(readme): update installation steps
test(auth): add login edge cases
chore(deps): update Spring Boot to 4.0
AI Attribution Rules
NEVER include in commits/PRs:
Co-authored-by: ClaudeMade by Claude/GPT/AIGenerated by AI@anthropic.com/@openai.com- Model names (claude, gpt-4, etc.)
Git hooks automatically block these patterns.
Release Process
Prepare Release
git checkout develop
git pull
# Create release branch
git checkout -b release/v2.1.0
# Update version, changelog
# ...
git commit -m "chore(release): prepare v2.1.0"
git push -u origin release/v2.1.0
Merge to Main
gh pr create --base main --title "Release v2.1.0"
# After approval:
gh pr merge --merge
Tag Release
git checkout main
git pull
git tag -a v2.1.0 -m "Release v2.1.0"
git push origin v2.1.0
Back-merge to Develop
git checkout develop
git merge main
git push
Emergency Hotfix
# Branch from main
git checkout main
git checkout -b hotfix/critical-fix
# Fix and commit
git commit -m "fix(critical): description"
# PR directly to main
gh pr create --base main
# After merge, back-merge to develop
git checkout develop
git merge main
git push
Useful Commands
# View branch status
git branch -vv
# Clean merged branches
git branch --merged develop | grep -v develop | xargs git branch -d
# Interactive rebase (before PR)
git rebase -i develop
# Amend last commit
git commit --amend
# Stash changes
git stash
git stash pop
Pre-Push Checklist
- ✅ Code formatted (
./gradlew spotlessApply) - ✅ Tests pass locally
- ✅ No AI attribution in commits
- ✅ Commit messages follow convention
- ✅ CI-Local passes (
./ci-local.sh full)
Related Skills
git-github: GitHub CLI and APIdevops-infra: CI/CD integrationtechnical-docs: Commit documentation