Git Remove deleted files en masse

When you work with a project sometimes you have to delete a lot of files that you don’t need anymore.
If you issue a git status command

$git status

Untitledit will show the missing files in the red. that means the files are missing from the folder, but they are still in the index.
The normal process is delete them manually using a gui file manager. Then

$git rm particular_file
$git commit -a -m "commit"

Now if you check the status, then the deleted file will show up in green as deleted.
Say you deleted close to 10 to 20 files, that means i have to manually remove each of them from the git index.
The easy way is to issue

$git add -u

this will update all the missing files and mark them as deleted.

after_update
now the commit will make sure that they are removed from the index

Posted in Uncategorized

Comments are closed.