# 拉取请求文档

了解如何创建、审查和合并拉取请求、解决合并冲突，以及在 GitHub 项目中高效协作。

## Recommended

* [拉取请求](/zh/pull-requests/reference/pull-requests)

  建议、查看和合并代码更改，使用拉取请求进行有效协作和维护代码质量。

* [Branches](/zh/pull-requests/reference/branches)

  Use branches in GitHub to isolate development work, manage default branches, and collaborate effectively using pull requests and branch protections.

* [创建拉取请求](/zh/pull-requests/how-tos/create-pull-requests/creating-a-pull-request)

  创建拉取请求以建议对存储库中的代码进行更改。

* [审查拉取请求中的建议更改](/zh/pull-requests/how-tos/review-pull-requests/reviewing-proposed-changes-in-a-pull-request)

  在合并之前，查看拉取请求中的提交、文件更改和差异，以提供反馈、批准更改或请求更新。

* [合并拉取请求](/zh/pull-requests/how-tos/merge-and-close-pull-requests/merging-a-pull-request)

  将拉取请求合并到上游分支，选择合并方法，并满足审核或状态检查等存储库要求。

* [Resolving a merge conflict on GitHub](/zh/pull-requests/how-tos/merge-and-close-pull-requests/resolving-a-merge-conflict-on-github)

  Resolve simple merge conflicts directly on GitHub using the conflict editor or handle complex cases via the command line.

* [为存储库创建分支](/zh/pull-requests/how-tos/work-with-forks/fork-a-repo)

  创建存储库分支 GitHub ，以便提出更改、协作处理项目以及管理自己的代码库副本。

* [Syncing a fork](/zh/pull-requests/how-tos/work-with-forks/syncing-a-fork)

  Sync a forked repository with its upstream repository using the web interface, GitHub CLI, or command line.

* [提交](/zh/pull-requests/reference/commits)

  了解如何在GitHub中提交保存对文件所做的更改、跟踪作者身份和组织项目的历史记录。

## Links

### Getting started

* [关于拉取请求](/zh/pull-requests/get-started/about-pull-requests)

  使用拉取请求在 GitHub 上提出、讨论和合并更改。

## Articles

* [关于拉取请求](/zh/pull-requests/get-started/about-pull-requests)

  使用拉取请求在 GitHub 上提出、讨论和合并更改。

* [关于分叉](/zh/pull-requests/get-started/about-forks)

  使用分支在自己的存储库副本中进行更改，并将它们建议回原始项目。

* [拉取请求快速入门](/zh/pull-requests/get-started/pull-request-quickstart)

  提出你的第一个更改，并将其从首次提交一路推进到拉取请求被合并。

* [关于查看拉取请求的快速入门](/zh/pull-requests/get-started/reviewing-pull-requests-quickstart)

  通过添加评论、提出建议以及批准或请求修改来审查拉取请求。

* [Writing code for a project](/zh/pull-requests/concepts/writing-code-for-a-project)

  Use branches, forks, commits, and pull requests to safely write, refine, and propose code changes for collaborative projects.

* [帮助他人评审你的更改](/zh/pull-requests/concepts/helping-others-review-your-changes)

  创建清晰、重点明确的拉取请求，以促进协作、简化审查，并让团队及时了解你的更改。

* [提供评论](/zh/pull-requests/concepts/giving-reviews)

  可通过对更改发表评论、提出修改建议，并在合并代码前批准或要求更新，来为拉取请求提供反馈。

* [处理评论](/zh/pull-requests/concepts/resolving-reviews)

  通过比较更改、更新代码并处理评论，解决评审反馈，使拉取请求为合并做好准备。

* [部署代码](/zh/pull-requests/concepts/deploying-code)

  验证部署前检查，选择合并策略，并在部署代码时有效地管理分支。

* [Managing branches within your repository](/zh/pull-requests/how-tos/commit-changes/managing-branches-within-your-repository)

  Create new branches for development and delete unused branches directly on GitHub.

* [将更改提交到从复刻创建的拉取请求分支](/zh/pull-requests/how-tos/commit-changes/committing-changes-to-a-pull-request-branch-created-from-a-fork)

  通过获取必要权限并有效使用 Git 命令，将更改提交到从分支创建的拉取请求分支。

* [创建包含多个作者的提交或代表某个组织创建提交](/zh/pull-requests/how-tos/commit-changes/creating-a-commit-with-multiple-authors)

  使用提交消息中的尾注，将提交归属给多个作者或组织，以提高协作效率和透明度。

* [更改提交消息](/zh/pull-requests/how-tos/commit-changes/changing-a-commit-message)

  在本地修改含义不清、不正确或敏感的提交消息，并将更新后的提交推送到 GitHub，其中包括编辑最近提交或较早提交的步骤。

* [比较提交](/zh/pull-requests/how-tos/commit-changes/comparing-commits)

  比较分支、标记、提交、分叉和日期，以有效地分析更改并跟踪存储库历史记录。

* [Troubleshooting commits](/zh/pull-requests/how-tos/commit-changes/troubleshooting-commits)

  Resolve common commit issues like incorrect user links, missing local commits, and push protection blocks.

* [创建拉取请求](/zh/pull-requests/how-tos/create-pull-requests/creating-a-pull-request)

  创建拉取请求以建议对存储库中的代码进行更改。

* [Creating a pull request from a fork](/zh/pull-requests/how-tos/create-pull-requests/creating-a-pull-request-from-a-fork)

  Create a pull request from a fork to propose changes to an upstream repository and collaborate on code effectively.

* [更改拉取请求的阶段](/zh/pull-requests/how-tos/create-pull-requests/changing-the-stage-of-a-pull-request)

  将草稿拉取请求标记为可供审查，或将处于打开状态的拉取请求重新转换为草稿，从而更有效地管理工作流程。

* [请求拉取请求审查](/zh/pull-requests/how-tos/create-pull-requests/requesting-a-pull-request-review)

  向个人或团队请求对你的拉取请求进行请求评审，以确保获得全面的反馈和协作。

* [使拉取请求与基础分支保持同步](/zh/pull-requests/how-tos/create-pull-requests/keeping-your-pull-request-in-sync-with-the-base-branch)

  将基础分支中的更改合并到拉取请求分支，以解决冲突并确保兼容性，然后再进行合并。

* [Changing the base branch of a pull request](/zh/pull-requests/how-tos/create-pull-requests/changing-the-base-branch-of-a-pull-request)

  Modify the base branch of an open pull request to compare changes against a different branch and ensure accurate updates.

* [在本地检查拉取请求](/zh/pull-requests/how-tos/review-pull-requests/checking-out-pull-requests-locally)

  在本地检出拉取请求，以解决合并冲突、测试变更或修改代码。

* [审查拉取请求中的建议更改](/zh/pull-requests/how-tos/review-pull-requests/reviewing-proposed-changes-in-a-pull-request)

  在合并之前，查看拉取请求中的提交、文件更改和差异，以提供反馈、批准更改或请求更新。

* [审核拉取请求中的依赖项变更](/zh/pull-requests/how-tos/review-pull-requests/reviewing-dependency-changes-in-a-pull-request)

  查看拉取请求中的依赖项更改，以识别已添加、更新或删除的依赖项，并在这些依赖项到达生产环境之前检测漏洞。

* [评论拉取请求](/zh/pull-requests/how-tos/review-pull-requests/commenting-on-a-pull-request)

  在 GitHub 的拉取请求中添加评论，包括常规反馈、针对特定代码行的建议以及文件级讨论，以促进协作并改进代码审查。

* [批准需要审查的拉取请求](/zh/pull-requests/how-tos/review-pull-requests/approving-a-pull-request-with-required-reviews)

  通过必需的评审来批准拉取请求，包括设置审批规则、审查更改并在合并前提交反馈。

* [查看拉取请求审查](/zh/pull-requests/how-tos/review-pull-requests/viewing-a-pull-request-review)

  查看并浏览单个拉取请求评审中的所有评论，从而了解相关更改和反馈。

* [忽略拉取请求审查](/zh/pull-requests/how-tos/review-pull-requests/dismissing-a-pull-request-review)

  驳回过时或未获批准的拉取请求审查，并通过必填评论更新其状态。

* [在拉取请求中加入反馈](/zh/pull-requests/how-tos/review-pull-requests/incorporating-feedback-in-your-pull-request)

  将建议的更改直接应用到拉取请求中，将多条建议合并为一次提交，或创建一个议题来跟踪超出范围的反馈。

* [Resolving a merge conflict on GitHub](/zh/pull-requests/how-tos/merge-and-close-pull-requests/resolving-a-merge-conflict-on-github)

  Resolve simple merge conflicts directly on GitHub using the conflict editor or handle complex cases via the command line.

* [Resolving a merge conflict using the command line](/zh/pull-requests/how-tos/merge-and-close-pull-requests/resolving-a-merge-conflict-using-the-command-line)

  Resolve merge conflicts using the command line by identifying conflicting changes, editing files, and committing resolutions.

* [必需状态检查故障排除](/zh/pull-requests/how-tos/merge-and-close-pull-requests/troubleshooting-required-status-checks)

  通过排查必需的状态检查，解决常见错误，并解除合并或推送到受保护分支时的阻碍。

* [合并拉取请求](/zh/pull-requests/how-tos/merge-and-close-pull-requests/merging-a-pull-request)

  将拉取请求合并到上游分支，选择合并方法，并满足审核或状态检查等存储库要求。

* [将拉取请求与合并队列合并](/zh/pull-requests/how-tos/merge-and-close-pull-requests/merging-a-pull-request-with-a-merge-queue)

  在 GitHub 中使用合并队列，简化拉取请求的合并流程，确保必要检查通过，并有效管理队列操作。

* [自动合并拉取请求](/zh/pull-requests/how-tos/merge-and-close-pull-requests/automatically-merging-a-pull-request)

  启用或禁用拉取请求的自动合并，以简化工作流，并在满足所有要求后自动合并更改。

* [还原拉取请求](/zh/pull-requests/how-tos/merge-and-close-pull-requests/reverting-a-pull-request)

  创建一个新的拉取请求，以撤销先前已合并的拉取请求，并处理可能出现的合并冲突。

* [关闭拉取请求](/zh/pull-requests/how-tos/merge-and-close-pull-requests/closing-a-pull-request)

  不合并直接关闭拉取请求，来管理不必要的更改或处理其他分支中的替代解决方案。

* [为存储库创建分支](/zh/pull-requests/how-tos/work-with-forks/fork-a-repo)

  创建存储库分支 GitHub ，以便提出更改、协作处理项目以及管理自己的代码库副本。

* [为分支配置远程存储库](/zh/pull-requests/how-tos/work-with-forks/configuring-a-remote-repository-for-a-fork)

  设置一个指向 Git 中的上游存储库的远程项，以同步分叉和原始存储库之间的更改。

* [Syncing a fork](/zh/pull-requests/how-tos/work-with-forks/syncing-a-fork)

  Sync a forked repository with its upstream repository using the web interface, GitHub CLI, or command line.

* [Allowing changes to a pull request branch created from a fork](/zh/pull-requests/how-tos/work-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)

  Enable collaboration by allowing repository maintainers to commit changes to pull request branches created from forks in your personal account.

* [分离分支](/zh/pull-requests/how-tos/work-with-forks/detaching-a-fork)

  通过离开网络或通过手动步骤创建独立存储库，断开存储库与其分支网络的连接。

* [拉取请求](/zh/pull-requests/reference/pull-requests)

  建议、查看和合并代码更改，使用拉取请求进行有效协作和维护代码质量。

* [Branches](/zh/pull-requests/reference/branches)

  Use branches in GitHub to isolate development work, manage default branches, and collaborate effectively using pull requests and branch protections.

* [叉子](/zh/pull-requests/reference/forks)

  了解分支如何通过创建与原始存储库相连、但具有各自设置和权限的独立存储库来实现独立协作。

* [提交](/zh/pull-requests/reference/commits)

  了解如何在GitHub中提交保存对文件所做的更改、跟踪作者身份和组织项目的历史记录。

* [Using query parameters to create a pull request](/zh/pull-requests/reference/using-query-parameters-to-create-a-pull-request)

  Use query parameters to create custom URLs that open pull requests with pre-filled titles, descriptions, labels, and more.

* [拉取请求审查](/zh/pull-requests/reference/pull-request-reviews)

  查看拉取请求以提供反馈、建议更改并确保合并前的代码质量。

* [Status checks](/zh/pull-requests/reference/status-checks)

  Understand how status checks ensure commits meet repository conditions, assist pull request reviews, and manage validations like builds, tests, and deployments.

* [合并拉取请求](/zh/pull-requests/reference/pull-request-merges)

  了解合并拉取请求的策略，包括合并提交、压缩合并和变基，以便有效地管理存储库的历史记录。

* [合并冲突](/zh/pull-requests/reference/merge-conflicts)

  确定并解决 Git 中的合并冲突，以确保顺利的分支集成和成功的拉取请求合并。

* [管理和标准化拉取请求](/zh/pull-requests/reference/managing-and-standardizing-pull-requests)

  使用模板、代码所有者、受保护的分支、规则集和自动化工具管理和标准化拉取请求，以保持一致且安全的存储库贡献。

* [使用预接收挂钩](/zh/working-with-pre-receive-hooks)

  在 GitHub Enterprise Server 上使用预接收挂钩强制实施存储库策略并阻止机密或无效提交等问题。