git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Extracting a single commit or object

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 1, 2009, 16:52 UTC
Message-ID
<alpine.DEB.1.00.0901011747580.30769@pacific.mpi-cbg.de>
In-Reply-To
<21223948.post@talk.nabble.com>
Hi,
On Tue, 30 Dec 2008, yitzhakbg wrote:
> How would I extract a single commit from a repository by it's SHA1 (or 
> any other treeish)?
Your question is not precise enough to answer.  Are you looking for
- the commit message?
- the patch?
- all the files referenced by that commit?
- all the files _and revisions_ referenced by that commit?
The answer depends quite a lot on the question...
> For that matter, how is any one single object extracted? Examples please.
The user-friendly way to look at a tree is
	git show HEAD:Documentation/
or some such.  Likewise, you can inspect single blobs like this:
	git show HEAD:README

If you activated bash completion, you can even complete monsters like this:

	git show \
v1.5.3:v1.5.3:t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master

Hth, Dscho

Previous: Alex RiesenNext: Miklos Vajna
Message 4 of 6 in “Extracting a single commit or object”
  1. yitzhakbgDec 30, 2008
  2. Shawn O. PearceDec 30, 2008
  3. Alex RiesenJan 1, 2009
  4. Johannes SchindelinJan 1, 2009
  5. Miklos VajnaJan 1, 2009
  6. Johannes SchindelinJan 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.