Article version: Enterprise Server 2.14

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-07-12. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Merging a pull request

Merge a pull request into the upstream branch when work is completed. Anyone with push access to the repository can complete the merge.

If the pull request has merge conflicts, or if you'd like to test the changes before merging, you can check out the pull request locally and merge it using the command line.

If you decide you don't want the changes in a topic branch to be merged to the upstream branch, you can close the pull request without merging.

Required reviews

Repository administrators can require that all pull requests receive a specific number of approving reviews from people with write or admin permissions in the repository or from a designated code owner before they're merged into a protected branch. For more information, see "About protected branches."

When required reviews are enabled, anyone with access to the repository can approve changes in a pull request. However, you won't be able to merge your pull request until the required number of reviewers with write or admin permissions in the repository approve your pull request's changes in their review. For more information about repository permission levels, see "Repository permission levels for an organization." If review is required from a designated code owner and the pull request affects code that has a designated owner, approval from that owner is required.

If a pull request has changed since it was reviewed and the person who requested changes isn't available to give an approving review, repository administrators or people with write access can dismiss a review. For more information, see "Dismissing a pull request review."

After all required reviewers have approved a pull request, you won't be able to merge it if there are other open pull requests with pending or rejected reviews and those pull requests have a head branch pointing to the same commit. Someone with write or admin permissions will need to approve or dismiss the blocking review on the other pull requests before you can merge.

Merging a pull request on GitHub Enterprise

  1. Under your repository name, click Pull requests.

    Issues and pull requests tab selection

  2. In the "Pull Requests" list, click the pull request you'd like to merge.

  3. Depending on the merge options enabled for your repository, you can:

    Note: Rebase and merge will always update the committer information and create new commit SHAs. For more information, see "About pull request merges."

  4. If prompted, type a commit message, or accept the default message.

    Commit message field

  5. Click Confirm merge, Confirm squash and merge, or Confirm rebase and merge.

  6. Optionally, delete the branch. This keeps the list of branches in your repository tidy.

Pull requests are merged using the --no-ff option, except for pull requests with squashed or rebased commits, which are merged using the fast-forward option.

You can close corresponding issues using a keyword in your pull request or commit message. For more information, see "Closing issues using keywords."

Further reading

Ask a human

Can't find what you're looking for?

Contact us