From: Junio C Hamano Date: Tue, 07 May 2019 04:57:55 GMT Subject: Re: [PATCH v3 00/16] Add new command 'restore' Message-ID: In-Reply-To: <20190507022127.GA220818@google.com> Emily Shaffer writes: > Then, figuring that I only had a few files, I thought I'd type them > each, with the exception of a .c/.h pair: > > g restore --staged builtin/log.c builtin/walken.c revision.* > > Because I had build artifacts present, this vomited while trying to > unstage revision.o, and again left me with all my changes still staged. > revision.o is validly ignored: > > $ g check-ignore revision.o > revision.o Often a claim "validly ignored" by users needs to be taken with a grain of salt. When it is in the index, it is no longer ignored. Assuming that you do not have revision.o in the index, and if "restore" is still "checkout -- " in disguise, then I think you could ask "git" not your shell to expand the asterisk, by protecting it from the shell, i.e. $ git restore --staged revision.\* and the pathspec should not match untracked revision.o. And if that does not work, you found a bug in restore, I think ;-).