Icon

How to Merge a Pull Request on GitHub

Learn how to review, update commit descriptions, and successfully merge an open pull request into your repository's main branch on GitHub.

By Matt

This guide explains how to merge an open pull request into your repository's main branch. Completing this task allows you to finalize code changes and integrate new features or bug fixes into your project.

This process applies to developers, maintainers, and open-source contributors managing code reviews. Use this workflow after a pull request has been reviewed and approved for integration.

Navigate to your GitHub account and locate the repository you want to update.

1
Click on your repository to open it.
Step #1: Click on your repository to open it.
2
Click the Pull requests tab near the top of the repository page.
Step #2: Click the Pull requests tab near the top of the repository page.
3
Select the open pull request you want to merge.
Step #3: Select the open pull request you want to merge.

Review the changes to ensure they are ready for production.

4
Click the green Merge pull request button at the bottom of the page.
Step #4: Click the green Merge pull request button at the bottom of the page.
5
Click inside the extended description text box to provide a sensible commit message detailing the changes.
Step #5: Click inside the extended description text box to provide a sensible commit message detailing the changes.
6
Click Confirm merge to finalize the integration.
Step #6: Click Confirm merge to finalize the integration.

Once processed, GitHub will display a message indicating the pull request was successfully merged and closed.

Term

Definition

Repository

A central location where code, files, and their version histories are stored.

Pull request

A proposed set of changes submitted to a repository for review before being merged into the main codebase.

Merge

The process of integrating the changes from a pull request or branch into another branch.

Commit message

A brief explanation describing the changes made in a specific code revision.