Skip to main content

Git Workflow

We follow a feature branch workflow with pull request reviews before merging to the main branch.

Branch Naming Convention

Use descriptive branch names that follow this pattern:
Types:
  • feature/ - New features or enhancements
  • fix/ - Bug fixes
  • hotfix/ - Urgent production fixes
  • refactor/ - Code refactoring
  • docs/ - Documentation updates
  • test/ - Test additions or modifications
Examples:
Include the ticket or issue number in your branch name to maintain traceability.

Development Process

1

Create a New Branch

Always branch from the latest main branch:
2

Make Your Changes

Develop your feature with frequent, atomic commits:
3

Keep Branch Updated

Regularly sync your branch with main to avoid conflicts:
If you’ve already pushed your branch, use git push --force-with-lease after rebasing.
4

Run Tests and Linting

Ensure all checks pass before pushing:
5

Push Your Branch

Push your branch to the remote repository:
6

Create a Pull Request

Open a pull request on GitHub/GitLab with a descriptive title and description.

Commit Message Convention

We use Conventional Commits for clear and consistent commit history.

Format

Types

  • feat - A new feature
  • fix - A bug fix
  • docs - Documentation changes
  • style - Code style changes (formatting, semicolons, etc.)
  • refactor - Code refactoring without changing functionality
  • perf - Performance improvements
  • test - Adding or updating tests
  • chore - Maintenance tasks, dependencies, build process
  • ci - CI/CD configuration changes

Examples

When introducing breaking changes, add BREAKING CHANGE: in the footer:

Pull Request Guidelines

PR Title

Use the same convention as commit messages:

PR Description Template

Provide comprehensive context in your PR description:

PR Size Guidelines

Keep PRs small and focused. Large PRs are harder to review and more likely to introduce bugs.
Ideal PR sizes:
  • Small: < 200 lines changed
  • Medium: 200-400 lines changed
  • Large: 400-800 lines changed
  • Too Large: > 800 lines (consider breaking it up)

Code Review Process

For Authors

1

Self-Review First

Review your own PR before requesting reviews. Check for:
  • Code quality and readability
  • Unnecessary console logs or debug code
  • Proper error handling
  • Test coverage
2

Request Reviews

Assign appropriate reviewers based on the changes:
  • At least one senior developer
  • Domain experts if touching critical areas
3

Address Feedback

Respond to all comments and make requested changes:
4

Resolve Conversations

Mark conversations as resolved once addressed.

For Reviewers

Provide constructive, actionable feedback: Good feedback:
Poor feedback:

Review Checklist

  • Code is clear and maintainable
  • No unnecessary complexity
  • Proper error handling
  • Security considerations addressed
  • Performance implications considered
  • Tests are comprehensive
  • Documentation is updated
  • No hardcoded values or secrets
  • Accessibility standards met
  • Browser compatibility considered

Continuous Integration

All PRs must pass CI checks before merging:

Automated Checks

CI failures should be addressed immediately. Don’t request reviews until all checks pass.

Merging Strategy

We use squash and merge for most PRs to keep the main branch history clean.

When to Use Each Strategy

Use for feature branches with multiple commits:
Use when commits are already well-organized and atomic:
Rarely used, only for combining long-lived branches:

Conflict Resolution

When encountering merge conflicts:
1

Update Your Branch

2

Resolve Conflicts

Open conflicted files and resolve markers:
Choose the correct resolution:
3

Continue Rebase

4

Force Push

Never use git push --force without --force-with-lease, as it can overwrite others’ work.

Release Process

For production releases:
  1. Create a release branch from main
  2. Update version numbers and changelog
  3. Create a release PR
  4. After approval, merge and tag the release
  5. Deploy to production