Use git diff.

git diff [<options>] <commit>..​<commit> [--] [<path>…​]

<commit> is a branch name, a commit hash, or a shorthand symbolic reference.

Examples:

git diff abc123..def567

git diff HEAD..origin/master

That will produce the diff between the tips of the two branches. If you'd prefer to find the changes that occurred in the common ancestor since the branch was started off, you can use three dots instead of two:

git diff <commit>...<commit>

To check which files differ, not how the content differs, use --name-only:

git diff --name-only <commit>..​<commit>

Note that in the <commit>..<commit> (two dot) syntax, the dots are optional; the following is synonymous:

git diff commit1 commit2
Answer from Lazy Badger on Stack Overflow
🌐
Graphite
graphite.com › guides › git-diff-between-branches
Using git diff between branches
This command will show the diff output of what is different between the end of branch1 and the end of branch2. It lists all the changes made in branch2 relative to branch1. ... This file contains sample text.
🌐
Unfuddle
unfuddle.com › stack › tips-tricks › git-compare-two-branches
Unfuddle Support | Git - Compare Two Branches
Using git-diff&nbsp you can compare two branches by viewing a diff between them, or you can use git-log to view a list of commits that comprise the difference between them.
🌐
Git
git-scm.com › docs › git-diff
Git - git-diff Documentation
This is synonymous to the earlier ... <commit>...<commit> [--] [<path>...] This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>. git diff A...B is equivalent to git diff $(git merge-base ...
🌐
Medium
medium.com › @arifhaidari336 › comparing-two-branches-in-git-and-github-a-complete-guide-8e2d0e20b14d
Comparing Two Branches in Git and GitHub: A Complete Guide | by Arif Haidari | Medium
April 11, 2025 - This shows what’s in development but not in your branch. Task Git Command GitHub Option View code diff git diff branch1..branch2 GitHub compare URL View changed files git diff --name-only branch1..branch2 GitHub file list in compare view View commit log git log branch1..branch2 Shown in GitHub compare UI Compare specific file git diff branch1..branch2 -- path/to/file Not directly supported on GitHub
Find elsewhere
🌐
Better Stack
betterstack.com › community › questions › how-to-compare-to-branches
How Can I See the Differences between Two Branches? | Better Stack Community
June 24, 2024 - To see the differences between two branches in Git, you can use the git diff command followed by the names of the branches you want to compare.
🌐
Reddit
reddit.com › r/dotnet › compare two branches of a git repository and list changes since they diverged
r/dotnet on Reddit: Compare two branches of a Git Repository and list changes since they diverged
January 9, 2022 -

I am upgrading an asp.net mvc (.net framework) application to .net5. When I started I created a new branch in the git repository for the migration. Unfortunately, as much as I resisted, there were a few changes that I needed to make the the .net framework version after this point.

Is there a way to list the changes made to the master branch after the .net5 branch was created, to show me what I need to add the the .net5 branch to bring it to feature parity with the .net framework version?

I am solely using the git client inside Visual Studio 2022, but I am happy to hear cli or other gui solutions if it would make the job easier. The git repository is hosted on Azure DevOps if that makes a difference.

Cheers!

🌐
Baeldung
baeldung.com › home › git › find the differences between two git branches
Find the Differences Between Two Git Branches | Baeldung on Ops
February 6, 2024 - It’s possible to display differences not only between the branches, but also between the commits. The syntax for this is similar to the branch comparison. However, instead of branches, we need to specify the commit hashes that we want to compare: git diff b94a88bac17318fb3c3cc881d657c04de9fd7901 73ea8956375c10fe41c669ba8c6f6f9e01490452
🌐
Git Tower
git-tower.com › learn › git faq › how to compare two branches in git
How to Compare Two Branches in Git | Learn Version Control with Git
Learn how to compare Git branches: see changes, commits, or specific files. Use "git diff" and "git log" with examples to understand the differences.
Published   3 days ago
🌐
JetBrains
jetbrains.com › guide › tips › compare-with-branch
Compare With Branch - JetBrains Guide
February 17, 2023 - Use “Show Diff”, then navigate through the changes. ... Show the changes on a branch with the working tree. ... Group and commit changes related to certain tasks so you have a cleaner commit history. ... How you can create an IntelliJ IDEA project from your code in GitHub.
🌐
KodeKloud
kodekloud.com › blog › git-diff-how-to-compare-files-between-two-branches
Git Diff: How to Compare Files Between Two Branches
November 27, 2025 - This becomes especially important when merging or integrating changes from one branch into another. The git diff command provides a clear and concise way to view the discrepancies in file content between different branches.
🌐
CloudBees
cloudbees.com › blog › git-diff-a-complete-comparison-tutorial-for-git
Git Diff: A Complete Comparison Tutorial for Git
September 14, 2021 - A common use case for diff is learning how a file changes between branches. For that, pass the path to the file at the end of the command. Example: ... The same reasoning works for diffing a file across commits, which makes perfect sense when ...
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-compare-two-branches-in-git
How to compare two branches in Git?
February 20, 2021 - Denotes that the file is modified and its content is different in the two branches · Denotes that the file is deleted from the current branch but is available in the other branch. dell@DESKTOP−N961NR5 MINGW64 /e/tut_repo (master) S git diff ...
🌐
GitKraken
gitkraken.com › home › learn › git diff
Git Diff | Learn Git
January 20, 2026 - What does ‘diff’ mean in Git? A diff takes two data sets and shows you what has changed between them. Data sets can be files, commits, branches, etc.
🌐
Git
git-scm.com › book › en › v2 › Git-Branching-Basic-Branching-and-Merging
Git - Basic Branching and Merging
$ git checkout master Switched to branch 'master' $ git merge iss53 Merge made by the 'recursive' strategy. index.html | 1 + 1 file changed, 1 insertion(+) This looks a bit different than the hotfix merge you did earlier. In this case, your development history has diverged from some older point.