Re: checkout extra files
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 3, 2012, 13:59 UTC
- Message-ID
- <CACsJy8A6-Ok34QDqgSVavFDBE81UdcK4rLzkHe7P7UO=fXptGw@mail.gmail.com>
- In-Reply-To
- <CAB9Jk9BvQmFfTq3a+e-7t-66s06jLK4fWuZB+MJHrAtbznBvHw@mail.gmail.com>
On Mon, Sep 3, 2012 at 8:42 PM, Angelo Borsotti <angelo.borsotti@gmail.com> wrote:
Show 7 quoted lines
> $ git checkout 94d8 -- * > $ ls > f1 > > Note that the work directory is empty when the checkout is done, and > that the checkout restores f1 > in it, a file that is not denoted by the * pathspec.
I think in this case '*' remains unexpanded by the shell. Which means it is still a pathspec to checkout (iow equivalent to "git checkout 94d8 -- '*'"). Checkout in turns matches the pathspec '*' against the tree and decides to restore 'fl'.
It's confusing but I don't think there's much we can do about it.
> I guess that this is the intended behaviour, and that the man page > should be updated to tell exactly > what files git restores.
-- Duy