Git – git rm all missing files

There is no git rm . to stage the deleted files in a Git repository. Here are some alternatives which could help you to achieve that.

1. Stage deleted files only.

git ls-files --deleted | xargs git rm 

 

2. Stage the modified and deleted files.

git add -u

 

3. Stage all newly added, modified and deleted files.

git add -A

 

Done =)

Reference: StackOverflow – Removing multiple files from a Git repo that have already been deleted from disk

One thought on “Git – git rm all missing files”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.