Subject: Re: Can I checkout a single file without altering index?

From: "Neal Kreitzinger" <[email-masked]>
Date: Fri, 15 Oct 2010 13:30:06 -0500

"Christian Halstrick" <[email-masked]> wrote in message 
news:[email-masked]...
> Thank's a lot for all your responses. I know now how to solve my problem. 
> I'll
> definitely not going to commit my unit-test before my fix and publish that
> because then I would have commits in the history where tests fail. But 
> other
> suggested solutions do work.
>
> Still, all that sounds like workarounds for a lacking feature. Checkout 
> content
> to the worktree without altering the index. What do you think, couldn't 
> that be
> added as an option to checkout?
>
> -- Chris

FWIW, my understanding of the index is that it is the middle-man for moving 
things from your work-tree to the object-store AND for moving things from 
the object-store to your work-tree.  Therefore, when you checkout the blob, 
it first gets copied from the object-store to your index and then from the 
index to your work-tree.

However, there is an option in git-commit to copy files directly from the 
working-tree to the object-store by totally bypassing the index, but no one 
seems to do this or recommend doing this as normative practice.  None the 
less, this "exception" in the git-commit manpage does seem to set the 
precedent, so maybe it is also conceivable to copy objects directly from the 
object-store to the work-tree by totally bypassing the index.

Please note that I am responding because I am interested in the discussion 
and not because I know the answer.  I am not a git programmer so my 
observations only symptomatic and/or theoretical as a user.

v/r,
Neal