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

Re: How do I get the file contents from an arbitrary revision to stdout?

From
AMAlan Mackenzie <acm@muc.de>
Date
Oct 8, 2021, 18:15 UTC
Message-ID
<YWCKpH5ER1Z9Xm3E@ACM>
In-Reply-To
<20211008180123.ls62virahqthgpmb@meerkat.local>
Hello, Konstantin.
On Fri, Oct 08, 2021 at 14:01:23 -0400, Konstantin Ryabitsev wrote:
Show 8 quoted lines
> On Fri, Oct 08, 2021 at 05:51:17PM +0000, Alan Mackenzie wrote:
> > Hello, git.
> > 
> > I want to get a file's content from a particular revision onto stdout for
> > backup purposes.  I can't see how to do this.  Help me, please!
> > 
> > Let's say the file is foo.c, and I want to get the version from the head
> > revision of bar-branch.
> git show bar-branch:foo.c
Thank you indeed.  That works just right!
> -K
-- 
Alan Mackenzie (Nuremberg, Germany).
Previous: Konstantin RyabitsevNext: Jeff King
Message 3 of 6 in “How do I get the file contents from an arbitrary revision to stdout?”
  1. Alan MackenzieOct 8, 2021
  2. Konstantin RyabitsevOct 8, 2021
  3. Alan MackenzieOct 8, 2021
  4. Jeff KingOct 8, 2021
  5. Junio C HamanoOct 8, 2021
  6. Jeff KingOct 8, 2021

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.