Re: How to git checkout a orgin(unstage) version file in another directoy?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chunlin Zhang venit, vidit, dixit 17.02.2011 11:17:
> Michael J Gruber <git <at> drmicha.warpmail.net> writes:
> 
>> git --work-tree=. --git-dir="/media/linux/t/kernel/.git" checkout HEAD
> But after I test,I found that after run this command,the file I do 
> checkout action become unstaged.
> It is weard,because I have set the "--work-tree" to another directory.
> my command line for example:
> git --work-tree=. --git-dir="/media/linux/t/kernel/.git" checkout 
> HEAD -- Android.mk
> 
> You can test with a git repository.I have no idea how to work around now.
> 

So, you don't really want to "checkout" the file. You only want its
contents without updating the index. (My brain is apparently too
git-rotted already to even think of the possibility that you didn't mean
"our checkout" by "checkout").

Jonathan gave you the perfect solution for what you want.

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]