From: "Shawn O. Pearce" <spearce@spearce.org>
To: Bill Lear <rael@zopyra.com>
Cc: git@vger.kernel.org
Subject: Re: Contents of file for a commit
Date: Sat, 26 Jan 2008 23:40:27 -0500 [thread overview]
Message-ID: <20080127044027.GS24004@spearce.org> (raw)
In-Reply-To: <18332.1826.220373.129812@lisa.zopyra.com>
Bill Lear <rael@zopyra.com> wrote:
> How can I do the equivalent of 'cvs co -r <commit> -p <file>' in git?
> I want to see the entire contents of a file as it existed after a
> particular commit was introduced.
`git checkout $commit -- $path`
would get the file at that version into your working directory,
but also will update the index, thus staging the file for the
next commit.
You can also just view the file if you don't want those changes
to be made:
`git show $commit -- $path`
If you are scripting, use cat-file directly to avoid any CRLF
conversion or whatnot:
`git cat-file blob $commit:$path`
--
Shawn.
next prev parent reply other threads:[~2008-01-27 4:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-27 4:22 Contents of file for a commit Bill Lear
2008-01-27 4:28 ` Jeff King
2008-01-27 4:40 ` Shawn O. Pearce [this message]
2008-01-27 4:49 ` Jeff King
2008-01-27 5:01 ` Shawn O. Pearce
2008-01-27 14:31 ` Bill Lear
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=20080127044027.GS24004@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=rael@zopyra.com \
/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