Skip to main content

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.

谁可以使用此功能?

People with push access to the upstream repository of a fork in a personal account can commit to the forked branches.

When someone creates a pull request from their fork, they usually decide whether other people can commit to the pull request's compare branch. For greater collaboration, the author can give maintainers of the upstream repository—that is, anyone with push access to the upstream repository—permission to commit to the compare branch. See Forks.

Pull request authors can set these permissions when they create a pull request from a fork in a personal account. They can also update an existing pull request to let repository maintainers commit to the branch. See Creating a pull request from a fork.

Enabling repository maintainer permissions on existing pull requests

  1. On GitHub, navigate to the main page of the upstream repository of your pull request.

  2. Under the upstream repository name, click Pull requests.

    Screenshot of the main page of a repository. In the horizontal navigation bar, a tab, labeled "Pull requests," is outlined in dark orange.

  3. In the list of pull requests, navigate to the pull request that you'd like to allow commits on.

  4. 在用户拥有的分支中,如果你希望允许对上游存储库具有推送访问权限的任何人更改你的拉取请求,请选择“允许维护员编辑”。

    警告

    如果你的分支包含 GitHub Actions 工作流,则选项是“Allow edits and access to secrets by maintainers”****。 允许对包含 GitHub Actions 工作流程的复刻分支进行编辑,也会允许维护员编辑复刻的仓库的工作流程,从而可能暴露密码值并允许访问其他分支。

    Screenshot of a pull request. On the bottom right, the "Allow edits and access to secrets by maintainers" checkbox is enabled and outlined in orange.

Further reading