Keep it in the list.

Angelo Borsotti <> writes:

> Hi Carlos,
>> That grouping is not what it's saying. It doesn't update the files that
>> exist in the working tree matching some glob. It updates the files in
>> the working tree from either the index or a treeish. The pathspec
>> refers, as always, to the data source, and '*' matches all files.
>> It puts the named paths on to the working tree. Is that clearer?
> This was mi first understanding, until one day I had in the working directory
> a file that matched the <path> (the path was '*') and that was NOT in the
> index or a treeish. The git checkout command tried to copy it and
> complained that there was no such file to restore.

So you're saying that you ran

    git checkout <tree-ish> -- *

and git complained that there was no such file? This is because the
shell expanded the glob and gave git a list of files.

> Then I thought that it visited the working directory and tried to restore
> each file it matched and at the end restored also the ones that were not
> there.

I can't quite parse this. Git will restore whichever files you tell it
to. If you use an asterisk, then your shell will usually expand it. In
the case you posted to the list there were no files, so there was
nothing to expand it to. Some shells complain in this case by default,
some don't and just pass the asterisk to the program and let it figure
out what to do with it. This was the case in your example. You told git
to expand all the files it found in that tree-ish.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to