Branch Management
Prerequisites: Git
Overview
Section titled “Overview”Jaypie uses a simple branch workflow with main as the primary branch and feature branches for development.
Branch Naming
Section titled “Branch Naming”Ticket-Based
Section titled “Ticket-Based”feat/TICKET-IDfeat/DEV-123feat/GITHUB-456Description-Based
Section titled “Description-Based”feat/short-description-abc12345
# Pattern: feat/{2-3 word description}-{first 8 chars of commit hash}Naming Guidelines
Section titled “Naming Guidelines”- Lead with most important word
- 2-3 words maximum
- Use hyphens, not underscores
- Lowercase
Examples
Section titled “Examples”| Good | Bad |
|---|---|
feat/streaming-handler |
feat/add_new_streaming_handler_for_sse |
fix/lambda-timeout |
fix/FixTheLambdaTimeoutBug |
feat/DEV-123 |
feature/DEV-123-implement-user-auth |
Workflow
Section titled “Workflow”1. Create Branch
Section titled “1. Create Branch”git checkout maingit pullgit checkout -b feat/description-abc123452. Make Commits
Section titled “2. Make Commits”# After each validated changegit add .git commit -m "type: scope: description"3. Push Branch
Section titled “3. Push Branch”git push -u origin feat/description-abc123454. Create PR
Section titled “4. Create PR”Create pull request via GitHub CLI or web interface.
Pull Request Process
Section titled “Pull Request Process”PR Title
Section titled “PR Title”Same format as commit:
feat: express: add streaming handlerPR Description
Section titled “PR Description”## Summary
- Added expressStreamHandler for SSE responses- Added createExpressStream helper
## Test plan
- [ ] Run `npm test -w packages/express`- [ ] Test streaming locally with `npm run dev`Creating PR
Section titled “Creating PR”gh pr create --title "feat: express: add streaming handler" --body "..."Branch Protection
Section titled “Branch Protection”main branch is protected:
- Requires PR review
- Requires passing CI
- No direct pushes
CI Triggers
Section titled “CI Triggers”| Branch Pattern | Workflow |
|---|---|
feat/* |
npm-check.yml |
fix/* |
npm-check.yml |
main |
npm-deploy.yml |
deploy-* |
npm-deploy.yml |
Keeping Branch Updated
Section titled “Keeping Branch Updated”Rebase (Preferred)
Section titled “Rebase (Preferred)”git fetch origingit rebase origin/mainMerge (If Conflicts Complex)
Section titled “Merge (If Conflicts Complex)”git fetch origingit merge origin/mainCleaning Up
Section titled “Cleaning Up”After PR Merged
Section titled “After PR Merged”git checkout maingit pullgit branch -d feat/old-branchDelete Remote Branch
Section titled “Delete Remote Branch”GitHub auto-deletes after merge, or manually:
git push origin --delete feat/old-branchCommit Best Practices
Section titled “Commit Best Practices”Small Commits
Section titled “Small Commits”Each commit should be:
- Single logical change
- Independently buildable
- Self-contained (tests pass)
Commit Often
Section titled “Commit Often”Commit after each successful validation step. Creates restore points.
Don’t Commit
Section titled “Don’t Commit”- Broken code
- Failing tests
- Unfinished changes
Related
Section titled “Related”- Development Process - Development workflow
- CI/CD - CI/CD configuration