3.7 KiB
Git Workflow Standards
Branch Structure
Main Branches
-
main
- Production-ready code
- Tagged releases only
- Protected branch
- Requires pull request approval
-
develop
- Integration branch
- Source for feature branches
- Continuous integration testing
- Pre-release staging
Supporting Branches
-
feature/*
- Branch from: develop
- Merge to: develop
- Naming: feature/descriptive-name
- Example: feature/permission-handlers
-
release/*
- Branch from: develop
- Merge to: main and develop
- Naming: release/v1.0.0
- For version preparation
-
hotfix/*
- Branch from: main
- Merge to: main and develop
- Naming: hotfix/critical-fix
- For urgent production fixes
Workflow Procedures
Initial Setup
-
Clone Repository: git clone https://gitea.sigd.net/chaulmark/ChessPrism.git cd ChessPrism
-
Create Develop Branch: git checkout -b develop git push -u origin develop
Feature Development
-
Create Feature Branch: git checkout develop git pull origin develop git checkout -b feature/your-feature
-
Development Cycle: git add . git commit -m "type: descriptive message" git push -u origin feature/your-feature
-
Complete Feature: git checkout develop git pull origin develop git merge feature/your-feature git push origin develop
Release Process
-
Create Release Branch: git checkout develop git checkout -b release/v1.0.0
-
Version Preparation: Update version numbers Final testing Documentation updates
-
Complete Release: git checkout main git merge release/v1.0.0 git tag -a v1.0.0 -m "Version 1.0.0" git push origin main --tags
git checkout develop git merge release/v1.0.0 git push origin develop
Commit Standards
Commit Message Format
type(scope): subject
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Formatting
- refactor: Code restructuring
- test: Adding tests
- chore: Maintenance
Examples
- feat(auth): implement permission handlers
- fix(capture): resolve screenshot timing issue
- docs(api): update endpoint documentation
Pull Request Process
-
Create Pull Request
- Clear title and description
- Reference related issues
- Include testing details
- Add relevant labels
-
Review Requirements
- Code review by team member
- CI/CD checks passed
- Documentation updated
- Tests included
-
Merge Guidelines
- Squash and merge preferred
- Delete branch after merge
- Update related issues
Version Control
Semantic Versioning
- Major.Minor.Patch
- Example: 1.0.0
Version Tags
- Release candidates: v1.0.0-rc.1
- Beta versions: v1.0.0-beta.1
- Alpha versions: v1.0.0-alpha.1
Best Practices
-
Regular Commits
- Commit early and often
- Keep commits focused
- Use clear messages
-
Branch Management
- Regular develop syncs
- Clean up merged branches
- Keep branches updated
-
Code Review
- Detailed reviews
- Constructive feedback
- Quick response times
Tools and Integration
-
Git Hooks
- Pre-commit linting
- Commit message validation
- Automated testing
-
CI/CD Integration
- Automated builds
- Test execution
- Deployment pipelines
-
Code Quality
- SwiftLint integration
- Test coverage checks
- Documentation validation
Emergency Procedures
-
Critical Bugs
- Create hotfix branch
- Expedited review process
- Immediate deployment
-
Recovery Steps
- Revert capabilities
- Backup procedures
- Rollback protocols
Workflow Automation
-
GitHub Actions
- Automated testing
- Build verification
- Documentation generation
-
Quality Gates
- Code coverage thresholds
- Performance benchmarks
- Security scanning