Skip to content

Branches

Proper branch naming and organization are essential for maintaining a clean, efficient workflow. Consistent branch names make it easy to identify what each branch does, link it to specific tasks, and understand its purpose at a glance. This organization prevents confusion when multiple team members are working on different features simultaneously, ensures a smooth code review process, and helps maintain a clear project history that’s easy to navigate and manage. This branch strategy is inspired by Github Branching Name best practices.


  • main → Main branch, represents the production state.
  • stageStaging branch, used for testing and integration before production.
  • dev → Represents the dev state of the project.

Each working branch follows this format:

<keyword>--<description>--<clickup-id>

Example:

feature--post-salesforce--86dxq5zn6
KeywordRecommended use
createAdd a new module or page
featureIntegrate a third-party service or add an endpoint
fixBug fixes
refactorCode restructuring without changing functionality
designVisual or design changes
testAdd or modify tests
  • Use kebab-case (lowercase with hyphens).
  • Keep it short and descriptive.
  • Avoid spaces, accents, or special characters.
  • Add the ClickUp card ID at the end for task tracking.
  • Example: --86dxq5zn6
create--module-cta-aninmated--86dxq5zn6
feature--post-to-salesforce--86dxq5zn6
fix--error-slider--86dxq5zn6
refactor--php-8-compatible--86dxq5zn6
design--update-header-spacing--86dxq5zn6
test--animation--86dxq5zn6

  1. Create a branch from main using the naming convention above: Example: fix--cardE--86XXXX
  2. Make your changes and verify everything works locally (tests/build/lint as applicable).
  3. Pull request of the dev or stage branch (whichever environment you’ll work) so you have the branch updated with the latest changes.
  4. Merge fix--cardE--86XXXX into branch dev or stage (depends of the needs) via merge process.
  5. Deploy to the Dev/Stage environment and validate the changes there.
  6. Is everything OK in Dev/Stage?
    • If no → fix issues on the same branch (fix--cardE--86XXXX) and repeat steps 2 to 5.
    • If yes → continue.
  7. Update your branch with the latest main. For that:
    • Switch to your branch fix--cardE--86XXXX
    • Pull latest main.
    • Merge main into your branch.
    • Verify again (tests/build).
  8. If all is OK, merge your branch into main.
  9. Deploy to production.
  10. Delete the working branch fix--cardE--86XXXX.

branch diagram


DODON’T
Use the format keyword--description--clickup-idCreate branches without following the naming convention
Use clear, short, kebab-case descriptionsUse spaces, uppercase letters, accents, or special characters
Always include the ClickUp card IDSkip the ClickUp ID or use an incorrect one
Create your working branch from mainStart working directly on main, stage, or dev
Keep branches focused on one taskMix multiple unrelated changes in one branch
Merge your branch into dev or stage for validationMerge directly into main without prior validation
Make sure dev, stage, and main match their environmentsLet branches drift from what’s deployed
Update your branch with the latest main before final mergeMerge outdated branches into main
Test your changes locally and in dev/stageDeploy without testing or reviewing
Keep every main branch separateMerge stage into production
Delete your branch after it’s merged and deployedKeep old branches after the work is done
Ask for help if you’re unsure about the flowGuess or improvise with merges and deploys

Knowledge Check

Test your understanding of this section

Loading questions...