| English | 中文 |
Feature Branch Workflow is the most straightforward collaboration model for most teams to adopt.
Its core principle is: develop every feature or fix in an independent branch, and merge it into the main branch via a PR when complete.
<integration-branch> -> feature branch -> pull request -> review -> CI -> merge
<integration-branch> denotes the team’s actual integration branch, such as main, master, or develop.
feat/user-login
fix/payment-timeout
docs/git-workflow-guide
refactor/order-validator
Branch names should express the intent of the task; avoid names like test, tmp, or new.
The longer a branch exists, the more it diverges from the main branch, making merge conflicts harder to resolve.
Before synchronizing, confirm that the current feature branch has no other pending edits, that collaborators have not based work on local commits, and that team rules allow a rebase.
git status --porcelain
git fetch origin
git rebase origin/<integration-branch>
Whether to use rebase depends on team conventions.
If a PR is already hard to review, break it down first.