git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: yitzhakbg <yitzhakbg@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Extracting a single commit or object
Date: Tue, 30 Dec 2008 14:21:06 -0800	[thread overview]
Message-ID: <20081230222106.GE29071@spearce.org> (raw)
In-Reply-To: <21223948.post@talk.nabble.com>

yitzhakbg <yitzhakbg@gmail.com> wrote:
> 
> How would I extract a single commit from a repository by it's SHA1 (or any
> other treeish)?
> For that matter, how is any one single object extracted? Examples please.

git cat-file $type $sha1

e.g.

git cat-file commit $commitsha1
git cat-file blob $blobsha1

If you need to inspect a tree, ls-tree is probably better:

git ls-tree $commitsha1
git ls-tree $treesha1

-- 
Shawn.

  reply	other threads:[~2008-12-30 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-30 22:15 Extracting a single commit or object yitzhakbg
2008-12-30 22:21 ` Shawn O. Pearce [this message]
2009-01-01 22:06   ` Alex Riesen
2009-01-01 16:52 ` Johannes Schindelin
2009-01-01 18:08   ` Miklos Vajna
2009-01-02 17:37     ` Johannes Schindelin

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=20081230222106.GE29071@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=yitzhakbg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).