From: René Scharfe Date: Sun, 08 Oct 2017 12:39:05 GMT Subject: Re: "git rm" seems to do recursive removal even without "-r" Message-ID: <05775b3d-2e88-9ceb-e8d2-8ff2373cfdb5@web.de> In-Reply-To: [My SMTP server still refuses to accept emails to rpjday@crashcourse.ca and reports "mailbox unavailable" and "invalid DNS MX or A/AAAA resource record." So just replying to the list.] Am 08.10.2017 um 13:56 schrieb Robert P. J. Day: > but as i asked in my earlier post, if i wanted to remove *all* files > with names of "Makefile*", why can't i use: > > $ git rm 'Makefile*' > > just as i used: > > $ git rm '*.c' > > are those not both acceptable fileglobs? why does the former clearly > only match the top-level Makefile, and refuse to cross directory > boundaries? > > $ git rm -n 'Makefile*' > rm 'Makefile' > $ Try: $ git rm -n '*Makefile' The whole path is considered. The asterisk there matches any directory part -- but also any file name prefix. Check the entry for "pathspec" in gitglossary(7) for more details. René