List changed files for the current git branch

List files, changed in the current branch (HEAD), comparing to the source branch (main):

git diff --name-only main HEAD

Comparing with the current branch:

git diff --name-only main..

git

Somewhat related: