Overview
This Standard Operating Procedure (SOP) defines the git workflow processes for our 4-person development team using the gitflow branching model. This ensures consistent code management, quality control, and efficient collaboration.
flow overview
- normal feature: feat-youtrack-xxx => test => staging => master
- hot-fix: hotfix-xxxx[checkout from master] => staging => master => test
Branch Structure
Main Branches
master (Production Branch)
- Contains production-ready code
- Only accepts merges from
staging and hotfix branches
- Always deployable
- Protected branch requiring pull request reviews
test (Integration Branch)
- Integration branch for ongoing development
- Contains latest development changes
- Source for creating feature branches
- Target for merging completed features
Supporting Branches
Feature Branches (feature/feature-name)
- Created from:
test
- Merged back to:
test
- Naming convention:
feature/youtrack-123-short-description or feature/user-authentication
Release Branches (staging/version)
- Created from:
test
- Merged to:
master
- Naming convention:
staging/v1.2.0
Hotfix Branches (hotfix/issue-description)
- Created from:
master
- Merged to:
master and test
- Naming convention:
hotfix/critical-login-bug
Workflow Processes
Feature Development Workflow
Create Feature Branch
git pull origin test
git checkout -b feat-youtrack-xxxx
Development
Make commits with clear, descriptive messages
Follow commit message format: [youtrack-xxxx] Add user authentication logic
Push regularly to keep remote branch updated
git add .
git commit -m "[youtrack-123] Add user authentication logic"
git push origin feature-youtrack-123-new-feature
Code Review Process
Create Pull Request (PR) to develop branch
Assign at least 1 team member as reviewer
Include PR template checklist
Address all feedback before approval
Merge to Develop
Release Workflow
Create Release Branch
git checkout test
git pull origin test
git checkout -b staging/v1.2.0
Release Preparation
Release Deployment
Create PR to master branch
Tag the release: git tag -a v1.2.0 -m "Release version 1.2.0"
Merge back to test to include any release fixes
Hotfix Workflow
Create Hotfix Branch
git checkout master
git pull origin master
git checkout -b hotfix/critical-security-fix
Fix and Test
Deploy Hotfix
Team Roles and Responsibilities
All Developers
- Follow branching conventions
- Write clear commit messages
- Create comprehensive PRs
- Participate in code reviews
- Keep feature branches up to date
Code Review Requirements
- Minimum 1 approval required for feature branches
- 2 approvals required for release and hotfix branches
- Review checklist must be completed
- No self-approvals allowed
Designated Roles
Release Manager (Rotates weekly)
- Manages release branch creation
- Coordinates release deployments
- Ensures proper tagging and versioning
Repository Maintainer (Respective Project Developer)
- Manages branch protection rules
- Handles complex merge conflicts
- Maintains gitflow standards
Code Review Checklist
For Reviewers
- [ ] Code follows team coding standards
- [ ] Business logic is correct
- [ ] Tests are included and pass
- [ ] No obvious security vulnerabilities
- [ ] Performance considerations addressed
- [ ] Documentation updated if needed
- [ ] No merge conflicts
For Authors
- [ ] PR title clearly describes changes
- [ ] Description includes context and testing notes
- [ ] Linked to relevant ticket/issue
- [ ] Self-reviewed the changes
- [ ] All automated checks pass
- [ ] Breaking changes documented
Best Practices
Commit Guidelines
- Use present tense: "Add feature" not "Added feature"
- Keep commits atomic (one logical change per commit)
- Include ticket/issue number in commit message
- Limit first line to 50 characters
Branch Management
- Keep feature branches short-lived (< 1 week)
- Regularly sync with
develop branch
- Delete merged feature branches
- Use descriptive branch names
Pull Request Guidelines
- Small, focused PRs are preferred
- Include screenshots for UI changes
- Provide context in PR description
- Respond to review feedback promptly
Emergency Procedures
Critical Production Issue
- Create hotfix branch from
master
- Implement minimal fix
- Get expedited review (1 approval minimum)
- Deploy immediately after approval
- Follow up with proper testing and documentation
Broken Develop Branch
- Identify the problematic commit
- Create fix branch from last known good commit
- Implement fix and create PR
- Coordinate with team before merging
Tools and Integration
Required Tools
- Git client (command line or GUI)
- GitHub/GitLab for repository management
- JIRA/Linear for ticket tracking
- Slack for team communication
Automated Checks
- Continuous Integration on all PRs
- Code quality checks (linting, formatting)
- Automated testing suite
- Security vulnerability scanning
Troubleshooting Common Issues
Merge Conflicts
- Update your branch:
git pull origin test
- Resolve conflicts in affected files
- Test that everything works
- Commit resolution:
git commit -m "Resolve merge conflicts"
Accidentally Committed to Wrong Branch
- Create correct branch:
git checkout -b correct-branch
- Cherry-pick commits:
git cherry-pick <commit-hash>
- Reset original branch:
git checkout wrong-branch && git reset --hard HEAD~1
Monitoring and Metrics
Weekly Review
- Review merged PRs and release velocity
- Identify process improvements
- Address any recurring issues
- Update SOP as needed
Key Metrics
- Average PR review time
- Number of hotfixes per release
- Feature delivery time
- Code quality scores
Last Updated: [Avarile Wang]
Next Review: [Quarterly]
Owner: Sansoni management Pty Ltd.