All of lore.kernel.org
 help / color / mirror / Atom feed
* How do I get the file contents from an arbitrary revision to stdout?
@ 2021-10-08 17:51 Alan Mackenzie
  2021-10-08 18:01 ` Konstantin Ryabitsev
  2021-10-08 20:02 ` Jeff King
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2021-10-08 17:51 UTC (permalink / raw)
  To: git

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.

I would like there to be a command something like:

    $ git cat bar-branch -- foo.c

..  Is there such a command, and if so, what's it called and how do I use
it?  I assumed it might be git cat-file, but I couldn't get it to work,
and couldn't understand it's man page.

Where might I have found this information for myself?

Thanks in advance for the help!

-- 
Alan Mackenzie (Nuremberg, Germany).

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-08 23:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-10-08 20:02 ` Jeff King
2021-10-08 21:54   ` Junio C Hamano
2021-10-08 23:01     ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.