I am comparing a path on two branches with git to prepare for merge. I want to list all files under this path, and their status with git diff, not only changed files.
Example:
I have a repository, currently on branch main, which has 3 files:
$ git status
On branch main
nothing to commit, working tree clean
$ ls -1
a.file
b.file
c.file
On a second branch new-branch, I perform three changes:
- delete
b.file - change
c.file - create
d.file
$ git status
On branch new-branch
nothing to commit, working tree clean
$ ls -1
a.file
c.file
d.file
Using git diff I can list the names and statuses of all changed files:
$ git diff --name-status main new-branch
D b.file
M c.file
A d.file
This is almost exactly what I want: I would also like to find a.file in this list. Something like this:
a.file
D b.file
M c.file
A d.file
Is this possible with git diff? Perhaps with git show?