Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-08-25. 已停止发布的版本不受支持。 即使针对重大安全问题,也不会发布补丁。 若要获得更好的性能、改进的安全性和 GitHub Enterprise Server 中的新功能,请参阅升级过程的 Overview。 如需升级帮助,请联系 GitHub Enterprise 支持。

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.

警告

When you change the base branch of your pull request, some commits may be removed from the timeline. Review comments may also become outdated because the line of code that the comment referenced may no longer be part of the changes in the pull request.

  1. 在仓库名称下,单击 “Pull requests”****。

    存储库的主页的屏幕截图。 在水平导航栏中,标记为“拉取请求”的选项卡以深橙色标出。

  2. In the "Pull Requests" list, click the pull request you want to modify.

  3. Next to the pull request title, click Edit title .

  4. In the base branch drop-down menu, select the base branch you'd like to compare changes against.

    Screenshot of a pull request title. The dropdown to change the base branch is outlined in dark orange.

  5. Read the information about changing the base branch and click Change base.

提示

When you open a pull request, GitHub sets the base to the commit that branch references. If the branch is updated in the future, GitHub does not update the base branch's commit.

Further reading