As stated above in "Why use
git rm instead of
git rm is actually a convenience command that combines the standard shell
git add to remove a file from the working directory and promote that removal to the staging index. A repository can get into a cumbersome state in the event that several files have been removed using only the standard shell
If intentions are to record all the explicitly removed files as part of the next commit,
git commit -a will add all the removal events to the staging index in preparation of the next commit.
If however, intentions are to persistently remove the files that were removed with the shell
rm, use the following command:
This command will generate a list of the removed files from the working directory and pipe that list to
git rm --cached which will update the staging index.