Git Workflow #

Our branching strategy and pull request process.

Branch Naming #

Use descriptive branch names with a prefix:

Prefix Use Case
feature/ New features
fix/ Bug fixes
chore/ Maintenance tasks
docs/ Documentation updates

Examples:

feature/user-authentication
fix/login-redirect-loop
chore/update-dependencies
docs/api-endpoints

Development Flow #

1. Create a Branch #

# Update main
git checkout main
git pull origin main

# Create feature branch
git checkout -b feature/my-feature

2. Make Changes #

Commit early and often with clear messages:

git add .
git commit -m "Add user authentication endpoint"

Commit Message Format #

<type>: <short description>

<optional body with more details>

Types: feat, fix, docs, style, refactor, test, chore

3. Push and Create PR #

git push -u origin feature/my-feature

Then create a Pull Request on GitHub.

Pull Request Guidelines #

Before Submitting #

  • [ ] Code compiles without errors
  • [ ] All tests pass
  • [ ] Code follows Code Standards
  • [ ] Self-reviewed the diff

PR Description Template #

## Summary
Brief description of changes

## Changes
- Added X
- Updated Y
- Fixed Z

## Testing
How to test these changes

## Screenshots (if UI changes)

Review Process #

  1. Request review from at least one team member
  2. Address all comments
  3. Get approval
  4. Squash and merge

Protected Branches #

  • main - Production code, requires PR approval
  • develop - Integration branch (if applicable)

Warning: Never force push to main or develop

Handling Conflicts #

# Update your branch with latest main
git checkout main
git pull origin main
git checkout feature/my-feature
git rebase main

# Resolve conflicts, then
git add .
git rebase --continue
git push --force-with-lease

See Also #