From: Jeff King Date: Sat, 07 Oct 2017 19:29:02 GMT Subject: Re: "git rm" seems to do recursive removal even without "-r" Message-ID: <20171007192902.ma4s47hn6edwldx5@sigill.intra.peff.net> In-Reply-To: On Sat, Oct 07, 2017 at 03:12:01PM -0400, Robert P. J. Day wrote: > ok, in that case, can you give me an example where "-r" makes a > difference, given that the man page refers to "a leading directory > name being given"? let's use as an example the linux kernel source, > where there are a *ton* of files named "Makefile" under the drivers/ > directory. > > should there be a difference between: > > $ git rm drivers/Makefile > $ git rm -r drivers/Makefile > > clearly, i have a "leading directory name" in both examples above ... > what should happen differently? Nothing, because there is nothing to recurse in the pathspecs you've given. Try: $ git rm drivers fatal: not removing 'drivers' recursively without -r versus $ git rm -r drivers [...removes everything under drivers/...] -Peff