| 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.
main -> feature branch -> pull request -> review -> CI -> merge
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.
git fetch origin
git rebase origin/main
Whether to use rebase depends on team conventions.
If a PR is already hard to review, break it down first.