↑ ↓ select, Enter open, Esc close

Show differences between two branches

Adjust the values, the command updates live
user@server
git diff --stat main...feature/contact-form

Compares the branch with the common ancestor of both branches (three dots) and lists changed files with the number of added and removed lines. This shows exactly what a merge would bring in, without changes made on the target branch. Without --stat, the full diff is shown.

Note: With two dots (main..feature), the two branch tips are compared directly, so changes made only on the target branch appear as well.

Also searched as

  • git compare two branches
  • what is different in this branch compared to main
  • which files will the merge change

Related one-liners

All in Git

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.