From: "J. Bruce Fields" <bfields@fieldses.org>
To: Bahadir Balban <bahadir.balban@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Getting a file revision
Date: Sat, 18 Aug 2007 20:52:29 -0400 [thread overview]
Message-ID: <20070819005229.GA12095@fieldses.org> (raw)
In-Reply-To: <7ac1e90c0708181742w531dab4asc7c90835cc56e8a1@mail.gmail.com>
On Sun, Aug 19, 2007 at 01:42:30AM +0100, Bahadir Balban wrote:
> This might sound like a novice question but anyway: I sometimes have a
> need to quickly recover an old revision of a file just to check
> something or copy some code from it. I would imagine having a command
> like:
>
> git-getrev <filename> <commit> or something, and the file would appear
> in its path, or the git root directory as <filename>.<commit>
>
> Is there an existing way to achieve a similar result? I can certainly
> checkout a branch, revert to that commit I want, copy the file, and
> come back to HEAD, but its not as quick.
Easiest is probably to use git-show together with the
<commit>:<filename> syntax, so e.g.:
git show v1.4:src/main.c
git show 74ace5df:Makefile >Makefile.tmp
--b.
prev parent reply other threads:[~2007-08-19 0:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-19 0:42 Getting a file revision Bahadir Balban
2007-08-19 0:52 ` Junio C Hamano
2007-08-20 11:38 ` Jerome Lovy
2007-08-21 12:49 ` [PATCH] Document the -p option for git-show Miklos Vajna
2007-08-21 13:09 ` Johannes Sixt
2007-08-21 14:29 ` VMiklos
2007-08-21 15:02 ` David Kastrup
2007-08-21 17:01 ` Robin Rosenberg
2007-08-21 17:33 ` Junio C Hamano
2007-08-21 18:50 ` Robin Rosenberg
2007-08-19 0:52 ` J. Bruce Fields [this message]
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=20070819005229.GA12095@fieldses.org \
--to=bfields@fieldses.org \
--cc=bahadir.balban@gmail.com \
--cc=git@vger.kernel.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 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.