How to Compare Branches in GitHub
While you can't compare two branches directly on GitHub, you can use the git diff command via your terminal or shell to view a detailed comparison of the two branches. Let's explore how to do it in a few easy steps.
Tyler Harz
|
3 steps
|
27 seconds
GitHub
1
Start by opening your terminal or shell.
2
CD into your repository.
3
Enter the git diff command in the following format: git diff main..second-branch [[Enter]] Type git diff, followed by the name of your first branch, two dots, and the second branch. The resulting output is a comparison of the two branches.