# How to Compare Two Branches in Github

> 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.

Canonical: https://livedemo.ai/tutorials/how-to-compare-two-branches-in-github/
Apps: GitHub
Updated: 2026-10-05
Interactive demo: https://story-api.livedemo.ai/workspaces/62255d3d3304f17b8f5e2d03/stories/692a3312ab56e05a00fd6ffd/preview?step=1

## Steps

1. Navigate to the repository where the branches are located.
2. Click on the 'Compare & pull request' button.
3. Click the branch dropdowns to change the base and compare branches.
4. The 'base' branch is the branch you want to compare to.
5. The 'compare' branch is the branch you want to compare from.
6. GitHub will show you a comparison of commits and changes or file differences between the two branches.
