git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: git@vger.kernel.org
Subject: Re: How do I get the file contents from an arbitrary revision to stdout?
Date: Fri, 8 Oct 2021 18:15:00 +0000	[thread overview]
Message-ID: <YWCKpH5ER1Z9Xm3E@ACM> (raw)
In-Reply-To: <20211008180123.ls62virahqthgpmb@meerkat.local>

Hello, Konstantin.

On Fri, Oct 08, 2021 at 14:01:23 -0400, Konstantin Ryabitsev wrote:
> 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).

  reply	other threads:[~2021-10-08 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 17:51 How do I get the file contents from an arbitrary revision to stdout? Alan Mackenzie
2021-10-08 18:01 ` Konstantin Ryabitsev
2021-10-08 18:15   ` Alan Mackenzie [this message]
2021-10-08 20:02 ` Jeff King
2021-10-08 21:54   ` Junio C Hamano
2021-10-08 23:01     ` Jeff King

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=YWCKpH5ER1Z9Xm3E@ACM \
    --to=acm@muc.de \
    --cc=git@vger.kernel.org \
    --cc=konstantin@linuxfoundation.org \
    /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).