The documentation for git-diff-files(1) says
Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B)...
However, the following commands do not show the added file (don't run this in a directory with an origin
subdirectory):
start=$PWD
origin="$start/origin"
rm -rf $origin
mkdir $origin
cd $origin
touch 1.txt
echo "2" > 2.txt
git init
git add -A
git commit -m "init"
echo "1" > 1.txt
rm 2.txt
echo "3" > 3.txt
git diff-files --diff-filter=ADM
The output looks like:
$ git diff-files --diff-filter=ADM
:100644 100644 e69de... 0000... M 1.txt
:100644 000000 0cfbf... 0000... D 2.txt
Does git diff-files
never show added files? The diff-filter
option suggests that it is capable of selecting added files.