Re: "git rm" seems to do recursive removal even without "-r"
- From
Jeff King <peff@peff.net>
- Date
- Oct 9, 2017, 17:52 UTC
- Message-ID
- <20171009175225.qn6a3j2th3dxjjn2@sigill.intra.peff.net>
- In-Reply-To
- <20171008204227.f6wgaobosa6yn62g@thunk.org>
On Sun, Oct 08, 2017 at 04:42:27PM -0400, Theodore Ts'o wrote:
Show 14 quoted lines
> On Sun, Oct 08, 2017 at 03:44:14PM -0400, Robert P. J. Day wrote: > > > > > > find <find args> | xargs git rm > > > > > > myself. > > > > that's what i would have normally used until i learned about git's > > magical globbing capabilities, and i'm going to go back to using it, > > because git's magical globbing capabilities now scare me. > > Hmm, I wonder if the reason why git's magically globbing capabilities > even exist at all is for those poor benighted souls on Windows, for > which their shell (and associated utilities) doesn't have advanced > tools like "find" and "xargs"....
One benefit of globbing with Git is that it restricts the matches only to tracked files. That matters a lot when you have a very broad glob (e.g., like you might use with "git grep") because it avoids looking at cruft like generated files (or even inside .git).
-Peff