From: Jeff King <peff@peff.net>
To: Geoffrey Irving <irving@naml.us>
Cc: git@vger.kernel.org
Subject: Re: automatically removing missing files beneath a directory
Date: Thu, 8 May 2008 12:44:56 -0400 [thread overview]
Message-ID: <20080508164456.GA29103@sigill.intra.peff.net> (raw)
In-Reply-To: <7f9d599f0805080939j3ef5e145w9bc2ac94f559b036@mail.gmail.com>
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
next prev parent reply other threads:[~2008-05-08 16:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 16:39 automatically removing missing files beneath a directory Geoffrey Irving
2008-05-08 16:44 ` Jeff King [this message]
2008-05-08 17:12 ` Geoffrey Irving
2008-05-08 17:18 ` Jeff King
2008-05-08 17:19 ` Geoffrey Irving
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080508164456.GA29103@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=irving@naml.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).