Re: Is Git Add Supposed to Work Like This (git 2.50)?
- From
Jeff King <peff@peff.net>
- Date
- Sep 9, 2025, 18:42 UTC
- Message-ID
- <20250909184231.GB1912898@coredump.intra.peff.net>
- In-Reply-To
- <109prte$j8b$1@ciao.gmane.io>
On Tue, Sep 09, 2025 at 11:33:18AM -0700, Jon Forrest wrote:
Show 12 quoted lines
> On 9/9/25 9:00 AM, Jon Forrest wrote: > > > > > > If this were a big deal, which it isn't, I'd suggest a command line > > flag that says what to do if there's an invalid file specified on > > the command line. One setting of the flag would result in the > > current behavior and the other setting would result in all the > > invalid file(s) being ignored and the valid file(s) being > > handled normally. > > Nevermind. I should have checked the man page. > The '--ignore-errors' option already does this.
Oops, I think our mails just crossed. I don't think --ignore-errors does quite what you want, though:
$ touch foo $ git add foo bar fatal: pathspec 'bar' did not match any files $ git add --ignore-errors foo bar fatal: pathspec 'bar' did not match any files $ git status --porcelain ?? foo
-Peff