The problem is that wildcards will only expand to the names of files located on the file system (since the shell performs the extension, not git ). Since you deleted the files, they are not in the file system, so you need another command. There are two easy ways to add a delete operation.
git add -u
This will add all changes (including deletions) to the index.
git add full/path/to/deleted/file
Deletion will be added.
Alternatively, if you use git rm to delete files, the delete operation is automatically added for you.
To get a list of deleted file names, this command should work:
git status --porcelain | awk '/^ D/ {print $2}'
You can then pass the results to xargs , as Stephen Penny suggested.
source share