Keep two long-lived branches

| Branch | Purpose | Rule |
|---|---|---|
main | Released, production-ready code. | Merge only a tested release or urgent hotfix; tag each package. |
dev | Shared integration branch for the next release. | Feature pull requests target this branch. |
Never commit directly to main or dev. Require a pull request, review, and passing checks.
Build one change in a feature branch
git switch dev
git pull origin dev
git switch -c feature/TODO-123-add-priority
git push -u origin feature/TODO-123-add-priorityOpen a PR from the feature branch into dev. Put the Jira issue key in the branch and PR title, link the Confluence design or acceptance criteria, request review, and delete the branch after merge.

main and publish the tagged package.Release a package through main
- Create
release/1.2.0fromdev. - Allow only version bump, release notes, final tests, and small fixes.
- Approve a PR from the release branch to
main. - Tag the merge commit:
git tag v1.2.0, then publish the package frommain. - Merge the release branch back into
dev.
Build and publish artifacts only from the tagged
main commit. The tag answers “what code is in this package?”Fix production without waiting for dev
git switch main
git pull origin main
git switch -c hotfix/1.2.1-login-timeoutStart a hotfix from main, not dev. Test the minimal correction, open a PR to main, bump and tag the patch version, publish from main, then merge the hotfix back into dev.
Use Jira and Confluence as the shared record
- One branch and PR should solve one Jira issue.
- Write the decision and API contract in Confluence; link it from the PR.
- Use clear names:
feature/,release/, andhotfix/. - Keep PRs small, reviewed, and protected by automated checks.
- Do not rewrite shared branch history or force-push protected branches.
Source: Atlassian Gitflow Workflow.