拉取请求(PR)——或合并请求——是将更改从一个分支合并到另一个分支的请求,为代码审查、讨论和自动检查提供了一个地方,然后才能进行集成。PR 是现代协作开发和代码质量的核心。
什么是拉取请求
text
A PR proposes merging a branch (e.g. a feature) into another (e.g. main):
→ shows the DIFF (what changed), a description, and discussion
→ reviewers comment, request changes, or approve
→ CI runs automated checks (tests, linting, builds) on the PR
→ once approved + checks pass → MERGE into the target branch
→ It's a gate and collaboration point before code is integrated.
PR 工作流
text
1. Create a feature branch; make commits; push it
2. Open a PR (feature → main) with a clear description of what/why
3. Automated CHECKS run (tests, lint, build) — must pass
4. REVIEWERS examine the code: comment, suggest, approve, or request changes
5. Author addresses feedback (more commits)
6. Approved + checks green → MERGE (merge commit, squash, or rebase)
