Get all files that have been modified in git branch

Question

Is there a way to see what files have changed in a branch?

Answer

An alternative to the answer by @Marco Ponti, and avoiding the checkout:

git diff --name-only <notMainDev> $(git merge-base <notMainDev> <mainDev>)

If your particular shell doesn't understand the $() construct, use back-ticks instead.

What does "Changes not staged for commit" mean

Git: See my last commit