{"thread":{"id":"15586","subject":"Get a copy of an old version of a file, using git gui/gitk","startedAt":"2008-09-19T07:58:04Z","lastAt":"2008-09-19T08:20:47Z","messageCount":2,"participants":["Peter Krefting","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91094","messageId":"Pine.LNX.4.64.0809190855060.17960@ds9.cixit.se","threadId":"15586","inReplyTo":null,"subject":"Get a copy of an old version of a file, using git gui/gitk","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2008-09-19T07:58:04Z","receivedAt":"2008-09-19T07:58:04Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Hi!\n\nI am trying to introduce new people to Git, and am primarily showing\nhow to use the GUI tools (git gui/gitk), since the project is running\non Windows. A question that I couldn't answer arose:\n\nHow do I save a copy of an older version of a file (one that has either\nbeen modified locally, or an earlier version in the project history),\nfrom git gui or gitk?\n\n>From the command line, I would try to find the SHA-1 and use git\ncat-file, but I can't figure out how to do it from the GUIs. Or, to\nfall back to the command-line, how to get the SHA-1 for the object out\nof git gui/gitk.\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"91096","messageId":"20080919082047.GA10733@atjola.homenet","threadId":"15586","inReplyTo":"Pine.LNX.4.64.0809190855060.17960@ds9.cixit.se","subject":"Re: Get a copy of an old version of a file, using git gui/gitk","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-09-19T08:20:47Z","receivedAt":"2008-09-19T08:20:47Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.09.19 08:58:04 +0100, Peter Krefting wrote:\n> From the command line, I would try to find the SHA-1 and use git\n> cat-file, but I can't figure out how to do it from the GUIs. Or, to\n> fall back to the command-line, how to get the SHA-1 for the object out\n> of git gui/gitk.\n\nYou don't need the sha1 of the blob object, just the revision and the\nfilename, and then you can reference the blob using the\n<tree-ish>:<path> syntax.\n\nFor example:\n\tgit cat-file blob HEAD^^^:some/file.c\nor less plumb-ish:\n\tgit show HEAD^^^:some/file.c\n\nI've been told that neither cares about the CRLF conversion, and I don't\nknow if there's anything except \"git checkout\" that actually does care\nabout it. With checkout, you would do:\n\ngit checkout HEAD^^^ -- some/file.c\n\nBut that replaces the current version of that file in your working tree\nand index with the version from the HEAD^^^ revision, so that might not\nbe exactly what you were looking for.\n\nBjörn\n"}]}