Re: "git rm" seems to do recursive removal even without "-r"
- From
René Scharfe <l.s.r@web.de>
- Date
- Oct 8, 2017, 12:39 UTC
- Message-ID
- <05775b3d-2e88-9ceb-e8d2-8ff2373cfdb5@web.de>
- In-Reply-To
- <alpine.LFD.2.21.1710080736530.21897@localhost.localdomain>
[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:
Show 16 quoted lines
> 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é