On Thu, May 08, 2008 at 09:39:22AM -0700, Geoffrey Irving wrote:
If I have a subdirectory in a git repository, and I remove some files
without telling git, is there is a simple way to automatically run the
equivalent of 'git rm' for all the missing files? git commit -a would
work, except that I only want to remove files beneath a particular
subdirectory. git add <directory> does the equivalent operation for
adding files, but I don't see a way to automatically remove them
without parsing the output of git status.
See "git add -u", which will update the status of all already-tracked
files in paths you specify. Note that this will also stage changes in
modified files. If you truly want to just mark all removed files, you
can do something like:
git ls-files --deleted -z | xargs -0 git rm
-Peff