From: Paul Smith Date: Tue, 10 Oct 2017 12:19:39 GMT Subject: Re: "git rm" seems to do recursive removal even without "-r" Message-ID: <1507637979.8322.33.camel@mad-scientist.net> In-Reply-To: On Tue, 2017-10-10 at 04:36 -0400, Robert P. J. Day wrote: >   ah, now *that* is a compelling rationale that justifies the > underlying weirdness. but it still doesn't explain the different > behaviour between: > >   $ git rm -n 'Makefile*' >   $ git rm -n '*Makefile' I explained that behavior in the email up-thread from this reply: > Globbing in "git rm" matches on the FULL PATH, not just the file name. > So, if you have a list of Makefiles in your repository like: > > Makefile > foo/Makefile > bar/Makefile > > Then 'Makefile*' only matches the first one, since 'Makefile*' doesn't > match 'foo/Makefile' or 'bar/Makefile'. > > If you you worry that '*Makefile' will match things you don't want to > match, you'll have to use: > > git rm -n Makefile '*/Makefile'