How to Compare Two Branches in Github
- George Apostolov
How to Compare Two Branches in Github: step-by-step guide
Navigate to the repository where the branches are located.
Click on the 'Compare & pull request' button.
Click the branch dropdowns to change the base and compare branches.
The 'base' branch is the branch you want to compare to.
The 'compare' branch is the branch you want to compare from.
GitHub will show you a comparison of commits and changes or file differences between the two branches.
Quick answer: To compare two branches in GitHub, navigate to the repository, click the compare and pull request button, use the branch dropdowns to select your base and compare branches, and view the resulting comparison of commits, changes, and file differences.
About this GitHub tutorial
View file differences and commit changes between two branches by navigating to your repository and selecting them from the dropdowns on GitHub. This guide shows how to compare Two Branches in Github in 6 steps, starting with "Navigate to the repository where the branches are located" and finishing with "GitHub will show you a comparison of commits and changes or file differences between th...". The interactive demo above is a click-through copy of the real GitHub interface, so you can rehearse each step before doing it in your own account.
Frequently asked questions
How many steps does it take to compare Two Branches in Github?
6 steps. Each one is listed in order above, and the demo highlights exactly where to click.
Can I try it without changing my own account?
Yes. Clicking through the demo doesn't touch your GitHub data or settings. Once you know the flow, repeat it in your own workspace.
This tutorial is filed under GitHub. Related guides: How to Connect GitHub Source Control with Project Tools Using Zapier, How to Connect GitHub to Visual Studio Code and How to Create a Coda Dashboard for GitHub Issues. Last reviewed 05 Oct 2026.
Create your first interactive demo in minutes
No credit card required • Start building today





