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

Re: Get a copy of an old version of a file, using git gui/gitk

From
Ddhruva <dhruva@ymail.com>
Date
Sep 19, 2008, 08:32 UTC
Message-ID
<884843.41605.qm@web95002.mail.in2.yahoo.com>
Using gitk, you can branch at the change that has the file (and content, I am not using version as git does not version files) you want. Check out that branch and you will have that file (and all other files at that changeset). When you are done, you can just delete that branch... branching is _cheap_
-dhruva
----- Original Message ----
Show 36 quoted lines
> From: Björn Steinbrink <B.Steinbrink@gmx.de>
> To: Peter Krefting <peter@softwolves.pp.se>
> Cc: Git Mailing List <git@vger.kernel.org>
> Sent: Friday, 19 September, 2008 1:50:47 PM
> Subject: Re: Get a copy of an old version of a file, using git gui/gitk
> 
> On 2008.09.19 08:58:04 +0100, Peter Krefting wrote:
> > From the command line, I would try to find the SHA-1 and use git
> > cat-file, but I can't figure out how to do it from the GUIs. Or, to
> > fall back to the command-line, how to get the SHA-1 for the object out
> > of git gui/gitk.
> 
> You don't need the sha1 of the blob object, just the revision and the
> filename, and then you can reference the blob using the
> :syntax.
> 
> For example:
>     git cat-file blob HEAD^^^:some/file.c
> or less plumb-ish:
>     git show HEAD^^^:some/file.c
> 
> I've been told that neither cares about the CRLF conversion, and I don't
> know if there's anything except "git checkout" that actually does care
> about it. With checkout, you would do:
> 
> git checkout HEAD^^^ -- some/file.c
> 
> But that replaces the current version of that file in your working tree
> and index with the version from the HEAD^^^ revision, so that might not
> be exactly what you were looking for.
> 
> Björn
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
      Did you know? You can CHAT without downloading messenger. Go to http://in.webmessenger.yahoo.com/
Next: Björn Steinbrink
Message 1 of 2 in “Re: Get a copy of an old version of a file, using git gui/gitk”
  1. dhruvaSep 19, 2008
  2. Björn SteinbrinkSep 19, 2008

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.