Git Workflow Rules
File: docs/rules-git-workflow.md
Purpose: Standardized Git workflow and branching strategy for urbalurba-infrastructure
Target Audience: All contributors to the repository
Last Updated: September 21, 2024
📋 Overview
This document establishes Git workflow rules to ensure consistent, professional development practices and maintain code quality through proper branching, review, and merge strategies.
🎯 Core Principles
Principle 1: Feature Branch Workflow
- All development work happens on feature branches
- Never commit directly to
mainbranch - Feature branches are short-lived and focused on single features/fixes
Principle 2: Pull Request Required
- All changes to
mainmust go through Pull Requests (PRs) - PRs enable code review, discussion, and quality control
- PRs provide permanent documentation of changes and reasoning
Principle 3: Clean History
- Commit messages should be clear and descriptive
- Feature branches should be deleted after merge
- Main branch should have a clean, linear history
🚀 Mandatory Workflow Steps
Step 1: Create Feature Branch
# Always start from latest main
git checkout main
git pull origin main
# Create descriptive feature branch
git checkout -b feature/descriptive-name
Branch Naming Convention:
feature/+ descriptive name using kebab-case- Examples:
feature/litellm-shared-postgres,feature/git-workflow-rules - Be specific:
feature/fix-tika-readinessnotfeature/fix-bug
Step 2: Development and Commits
# Make your changes
# Commit frequently with clear messages
git add .
git commit -m "Clear description of what changed and why"
Commit Message Rules:
- Start with action verb (add, fix, update, remove, refactor)
- Be specific about what changed
- Include context if needed
- Examples:
- ✅
Fix LiteLLM pod readiness check to wait for Ready condition - ✅
Add 30-second initialization pause for OpenWebUI service test - ❌
bug fix - ❌
updates
- ✅
Step 3: Push and Create Pull Request
# Push feature branch to remote
git push origin feature/your-branch-name
# Create PR using GitHub CLI (preferred)
gh pr create --title "Descriptive PR Title" --body "$(cat <<'EOF'
## Summary
- Bullet point of key changes
- What problem this solves
- Impact on existing functionality
## Technical Changes
- Specific files/components modified
- New patterns or approaches introduced
- Breaking changes (if any)
## Test Results
- How you verified the changes work
- Specific test scenarios covered
- Performance impact (if applicable)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
PR Title Format:
- Start with action verb
- Be specific and descriptive
- Examples:
- ✅
Fix LiteLLM deployment with shared PostgreSQL and enhanced reliability - ✅
Add Git workflow rules documentation - ❌
Updates - ❌
Bug fixes
- ✅
Step 4: Code Review and Merge
# Open PR in browser for review
gh pr view --web
# After review/approval, merge via GitHub web interface
# Choose "Squash and merge" for clean history
Step 5: Clean Up
# Switch back to main and pull merged changes
git checkout main
git pull origin main
# Delete local feature branch
git branch -d feature/your-branch-name
✅ Required PR Content
PR Description Template
Every PR must include:
## Summary
- [Bullet point describing main change]
- [Problem this solves]
- [Impact on users/system]
## Technical Changes
- [Specific files modified]
- [New patterns introduced]
- [Dependencies added/removed]
## Test Results
- [How changes were verified]
- [Test scenarios covered]
- [Performance impact]
## Breaking Changes
- [List any breaking changes]
- [Migration steps required]
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Required PR Checks
Before creating PR, verify:
- All changes committed and pushed
- PR title follows naming convention
- PR description is complete and detailed
- Changes have been tested
- No secrets or sensitive data included
- Code follows existing patterns and conventions
🚫 Prohibited Practices
❌ Never Do This:
- Direct commits to
mainbranch - Force push to shared branches
- Commit secrets, API keys, or sensitive data
- Create PR without description
- Leave stale feature branches
- Merge without review (except for solo documentation updates)
❌ Avoid These Patterns:
- Generic commit messages ("fix", "update", "changes")
- Large PRs that change multiple unrelated things
- Keeping feature branches alive after merge
- Working on main branch directly