Git add - How to git rm all deleted files from repo excluding others

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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

Now, I d like to do this, excluding one directory. I tried this:

git rm $(git ls-files --deleted --exclude= sites/all/modules/imagecache_actions/ )

but it didn t work. Am I misusing the exclude tag?

Answers

git ls-files -d | sed  /^sites/all/modules/imagecache_actions//d  | xargs git rm

The -x --exclude option only works with untracked files.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/25632047/how-to-git-rm-all-deleted-files-from-repo-excluding-others

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils