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

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s