public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Chunlin Zhang <zhangchunlin@gmail•com>
To: git@vger•kernel.org
Subject: Re: How to git checkout a orgin(unstage) version file in another directoy?
Date: Thu, 17 Feb 2011 12:06:33 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110217T130405-970@post.gmane.org> (raw)
In-Reply-To: 20110217103431.GA8308@elie

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

  reply	other threads:[~2011-02-17 12:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17  7:00 How to git checkout a orgin(unstage) version file in another directoy? Chunlin Zhang
2011-02-17  8:26 ` Michael J Gruber
2011-02-17 10:03   ` Chunlin Zhang
2011-02-17 10:17   ` Chunlin Zhang
2011-02-17 12:35     ` Michael J Gruber
2011-02-17 13:30       ` Chunlin Zhang
2011-02-17 18:33   ` Junio C Hamano
2011-02-18  7:41     ` Michael J Gruber
2011-02-17 10:34 ` Jonathan Nieder
2011-02-17 12:06   ` Chunlin Zhang [this message]
2011-02-17 17:17     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110217T130405-970@post.gmane.org \
    --to=zhangchunlin@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox