I regularly use the following command to list files changed between two commits:
git diff --name-only SHA1 SHA2
It gives a list of files somewhat like this:
/src/example/file1 /src/example/file2 /src/example/file3
There is almost no end to how useful this is.
I'd really like to be able also to show alongside each file a brief reference to the change status, indicating whether a file was added, modified or deleted.
Here's an example to demonstrate the concept:
git diff --name-only --and-how-me-the-change-status SHA1 SHA2
A /src/example/file1 M /src/example/file2 D /src/example/file3
The change status (A, M, D) is shown as an example only, I don't mind what this is so long as it is unambiguous.
I'm aware that I can use the --diff-filter
option to list only added files, or only modified files or only deleted files. Using this option means I have to run three commands to get three lists of filenames. This is nice but could be nicer.
Is there a single command I can run to give me the above example output?