How to Compare Two Branches in Github
·2 min read
In this article
Here's how to compare two branches in GitHub
- Go to your GitHub repository that contains the branches you want to compare.
- Locate and click on the 'Compare & pull request' button in the repository interface.
- Use the branch dropdown menus to select your desired base and compare branches.
- Set the 'base' branch as the target branch you want to compare against.
- Choose the 'compare' branch as the source branch containing the changes you want to review.
- Review the generated comparison showing commits, file changes, and differences between your selected branches.
Ready to get started with
interactive demos?
Frequently Asked Questions
The base branch is your reference point or target branch that you're comparing against, while the compare branch contains the changes you want to review. Think of the base as 'what you have' and compare as 'what you want to add or change.'


