π You are here: Documentation Index β Setup Guide β Git Workflow
β‘οΈ Next: Development Guide
This document defines our Git workflow, branching strategy, and development lifecycle for the Legal AI Query & Referral System project. It ensures smooth collaboration between frontend and backend teams while supporting parallel development.
- Purpose: Production-ready code at completion of each phase
- Content: Fully tested, stakeholder-approved features
- Merge Frequency: End of each phase (every 2-4 sprints)
- Protection: Highest level (admin-only, 2 reviewers required)
- Purpose: Integration point for daily development work
- Content: Work-in-progress and completed features awaiting phase release
- Merge Frequency: Daily/multiple times per day
- Protection: Medium level (1 reviewer required)
feature/SPRNT2-XX-short-description
Examples:
feature/SPRNT2-14-chat-interfacefeature/SPRNT2-20-database-setupfeature/SPRNT2-21-ai-service-integration
bugfix/SPRNT2-XX-issue-description # Bug fixes
hotfix/critical-issue-description # Emergency production fixes
release/phase-X # Release preparation
# 1. Always start from latest develop branch
git checkout develop
git pull origin develop
# 2. Create feature branch with Jira ticket reference
git checkout -b feature/SPRNT2-14-chat-interface
# 3. Move Jira ticket to "In Progress" status
# 4. Begin development work# Make changes and commit frequently with meaningful messages
git add .
git commit -m "feat(SPRNT2-14): implement chat message validation
- Add message length validation
- Implement real-time validation feedback
- Add error message display
Closes SPRNT2-14"
# Push to remote branch at least daily
git push origin feature/SPRNT2-14-chat-interface# 1. Rebase on latest develop before creating PR
git checkout develop
git pull origin develop
git checkout feature/SPRNT2-14-chat-interface
git rebase develop
# 2. Resolve any conflicts and push rebased branch
git push origin feature/SPRNT2-14-chat-interface --force-with-lease
# 3. Create Pull Request to develop branch
# 4. Complete code review process
# 5. Merge after approval (squash merge preferred)<type>(scope): <description>
[optional body]
[optional footer]
- feat: New feature implementation (SPRNT2-XX)
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, whitespace)
- refactor: Code refactoring without feature changes
- test: Adding or updating tests
- chore: Build process, dependencies, tooling
# Feature implementation
feat(SPRNT2-14): add chat interface component
- Implement real-time message display
- Add message input validation
- Include typing indicators
- Add unit tests for chat functionality
Closes SPRNT2-14
# Bug fix
fix(SPRNT2-15): resolve AI service connection timeout
Fixed issue where AI service requests were timing out
after 30 seconds due to incorrect timeout configuration.
# Documentation
docs(SPRNT2-20): update API documentation
Added endpoint documentation for chat message
processing and AI query handling.- β Include Jira ticket reference in commit body
- β Use imperative mood ("add" not "added")
- β Keep subject line under 50 characters
- β Wrap body at 72 characters
- β Explain what and why, not how
Before Creating PR:
- Jira ticket reference in title and description
- Rebased on latest develop branch
- All tests passing locally
- Code follows style guidelines
- Documentation updated if needed
## π― Jira Ticket
Closes [SPRNT2-14](https://itproject24.atlassian.net/browse/SPRNT2-14)
## π Description
Brief description of the changes made and why they were necessary.
## β
Acceptance Criteria Met
- [ ] Chat interface displays messages correctly
- [ ] Message validation prevents empty submissions
- [ ] Real-time updates work properly
- [ ] Error handling is implemented
## π§ͺ Testing
- [ ] Unit tests added/updated and passing
- [ ] Manual testing completed successfully
- [ ] Cross-browser testing completed (if frontend)
- [ ] Integration testing with dependent components
## π· Screenshots/Demo
(Include screenshots for UI changes or GIFs for interactions)
## π Related PRs
(Link any related or dependent pull requests)
## π Checklist
- [ ] Code follows project coding standards
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Ready for review- β Require pull request reviews (minimum 2 reviewers)
- β Require status checks to pass (CI/CD pipeline)
- β Require branches to be up to date before merging
- β Restrict pushes to administrators only
- β Require conversation resolution before merging
- β Dismiss stale reviews when new commits pushed
- β Require pull request reviews (minimum 1 reviewer)
- β Require status checks to pass (CI/CD pipeline)
- β Require branches to be up to date before merging
- β Allow squash merging only (clean commit history)
- β Require conversation resolution before merging
- π Regular rebasing on develop required
- π Descriptive naming with Jira ticket reference
- π Single responsibility - one feature per branch
- β° Short-lived - complete within sprint timeframe
π΄ Immediate Notification Required:
- Merge conflicts that cannot be resolved quickly
- Breaking changes to shared APIs or data models
- CI/CD pipeline failures affecting other developers
- Critical bugs discovered in develop or main
π‘ Daily Communication:
- Feature completion and PR creation
- Blockers or dependencies on other team members
- Significant architecture decisions or changes
- Testing results and integration status
# When merge conflicts occur:
# 1. Attempt automatic resolution
git checkout feature/my-branch
git rebase develop
# 2. If conflicts are complex:
git rebase --abort
# 3. Coordinate with team:
# - Post in team chat
# - Schedule pair programming session
# - Review conflicting changes together
# - Resolve conflicts collaboratively
# 4. Test resolution thoroughly before pushing# Set up user information
git config --global user.name "Your Name"
git config --global user.email "your.email@student.unimelb.edu.au"
# Set up useful aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.sync '!git checkout develop && git pull origin develop'
# Set up default branch name
git config --global init.defaultBranch main
# Set up rebase as default for pull
git config --global pull.rebase true# Daily workflow
git sync # Pull latest develop
git checkout -b feature/SPRNT2-XX-desc # Create feature branch
git add . && git commit -m "feat: message" # Commit changes
git push origin feature/SPRNT2-XX-desc # Push to remote
# Integration workflow
git checkout develop && git pull # Get latest develop
git checkout feature/my-branch # Switch to feature
git rebase develop # Rebase on develop
git push origin feature/my-branch --force-with-lease # Push rebased
# Emergency commands
git stash # Save work temporarily
git stash pop # Restore stashed work
git reflog # Find lost commitsfeature/SPRNT2-14-chat-interface # Feature development
bugfix/SPRNT2-14-validation-fix # Bug fixes
hotfix/critical-ai-service-failure # Production emergencies
release/phase-1 # Release preparation- Start containers:
make dev-up - Create feature branch from develop with Jira ticket reference
- Make changes and commit frequently with conventional commit format
- Rebase on develop daily to avoid conflicts
- Run tests:
make test - Format code:
make format - Create Pull Request to develop branch
- Complete code review process
- Squash merge after approval
Team Structure:
- Product Owner: Adam
- Frontend Lead: Farah
- Backend Lead: Himank
- AI Lead: Yusuf
- Scrum Master: Bryan
π― Ready to Code? β Next: Development Guide