To merge a pull request on GitHub, open it, verify its base branch, satisfy any required reviews and status checks, choose an enabled merge method, and confirm. You need write permission, and repository settings determine which methods are available.
Merge a pull request on GitHub
- Open the pull request. Check its base branch—the branch receiving the changes—and make sure it is the intended destination. The head branch is the branch containing the proposed changes.
- Check whether it is ready. Review the pull request’s status for required approvals, status checks, or merge conflicts. Resolve any conflicts and meet the repository’s requirements before proceeding.
- Choose an available merge method. In the merge area, select the method enabled for this repository. You need write permission to merge.
- Review the commit details. For merge commit or squash, check the commit message and description GitHub presents; depending on repository configuration, you may be able to edit them.
- Confirm the merge. If requirements are still pending, you may be able to enable auto-merge instead, provided the repository has enabled it and you are authorized to do so.
Choose the right merge method
GitHub offers three standard methods. The repository’s configuration and applicable branch rules determine which appear as options.
| Method | Result on the base branch | Useful when | Tradeoff |
|---|---|---|---|
| Merge commit | Preserves the pull request branch’s commits and adds an explicit merge point. GitHub’s default merge method uses --no-ff. |
You want the branch’s commit history and a visible record of the merge. | Adds a merge commit and cannot be used when a linear-history rule applies. |
| Squash and merge | Combines the pull request’s commits into one commit on the base branch. | The pull request represents one logical change or contains small fixup commits. | Individual commits are not retained separately. Reusing the same long-lived branch after a squash can make already-merged changes appear in a later pull request and increase conflict work. |
| Rebase and merge | Places the pull request’s commits individually onto the base branch without a merge commit, producing linear history. | You want linear history and the pull request’s commits are already organized clearly. | GitHub creates new commit SHAs and updates committer information; originally empty commits are dropped. |
Repository maintainers configure which methods are allowed. A rule requiring linear history requires squash or rebase merging to be available. A merge queue can also control how a queued pull request is merged.
Why the merge button or a method may be unavailable
- You lack permission: Merging requires write permission to the repository.
- Reviews or checks are still pending: Required approvals and status checks must satisfy the repository’s rules.
- The pull request has conflicts: Resolve them before merging. GitHub provides a browser editor for simple conflicts; more complex cases can be resolved from the command line.
- The method is disabled: Check the repository’s allowed merge methods and applicable branch rules. A linear-history requirement rules out merge commits.
- The pull request is in a merge queue: Queue behavior can differ from a standard merge and may determine the merge method.
Use auto-merge when requirements are pending
If the repository has enabled auto-merge, an authorized user can enable it while required reviews or status checks are pending. GitHub then merges the pull request after its requirements are met. Auto-merge is not available in every repository or plan; check GitHub’s current documentation for eligibility and setup details: Automatically merging a pull request.
#1 Best Overall
When to resolve conflicts locally
For simple conflicts, GitHub’s browser conflict editor may be sufficient. For complex conflicts, resolve them locally: rebase workflows can require conflict resolution and a force push. Handle force pushes carefully because they rewrite branch history and can affect collaborators.
Quick Recap
Best Value
Rank #3
Rank #2
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




