To compare the current branch against main
branch:
$ git diff --name-status main
To compare any two branches:
$ git diff --name-status firstbranch..yourBranchName
There is more options to git diff
in the official documentation (and specifically --name-status
option).