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]

 



Jonathan Nieder <jrnieder <at> gmail.com> writes:

> 
> Chunlin Zhang wrote:
> Because you are writing a script, I'd suggest using one of the
> "low-level commands (plumbing)" listed in git(1).  Because you are
> retrieving a file, it would be one of the "interrogation commands".
> And because it is a single file, I suppose this should be git
> cat-file, git unpack-file, or git archive.
> 
> For example,
> 
> 	git cat-file blob HEAD:README
Wow,this solved my problem perfectly.
use this command for example:
git --work-tree=. --git-dir="/media/linux/t/kernel/.git" cat-file blob 
HEAD:Android.mk>Android.mk

Thanks !

> 
> will print the contents of README in the HEAD commit.
> 
> Because I am curious: what exactly would your script be used to do?
> Can the git diff-tree or git diff-files command help?
> 




--
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]