Git commit - Removing multiple files from a Git repo that have already been deleted from disk

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I have a Git repo that I have deleted four files from using rm ( not git rm), and my Git status looks like this:

#    deleted:    file1.txt
#    deleted:    file2.txt
#    deleted:    file3.txt
#    deleted:    file4.txt

How do I remove these files from Git without having to manually go through and add each file like this:

git rm file1 file2 file3 file4

Ideally, I m looking for something that works in the same way that git add . does, if that s possible.

Answers

git ls-files --deleted -z | xargs -0 git rm 

might be what you are looking for.. it works for me..

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-already-been-deleted-from-disk

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils