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

Retrieving a file at a before a specified commit

From
ELErik de Castro Lopo <mle+tools@mega-nerd.com>
Date
May 29, 2013, 06:47 UTC
Message-ID
<20130529164735.5489ab47953406745d9034ef@mega-nerd.com>
Hi all,
I have a commit like this:
    commit 4d77a3cee01db0412956d40875c79f51ac745acc
    tree 3443c9f633114c3bd2e015453a8c55a171e62b53
    parent 340d808ade8a79857bec40770f0eb4f98224c53d
    author ....
    committer .....

which modifies file A/B/C (ie specifically does not add, but changes an existing file in the repo).

I would then like to retrive the version of the file A/B/C before commit 4d77a3cee by using the parent commit 340d808a:

   git show 340d808ade8a79857bec40770f0eb4f98224c53d:A/B/C

which works for most files/commits I try this with, but doesn't work in one particular case.

Questions:
- Is my understanding of the above git command incorrect?
- Is this a corrupt repo? Is there some way to check?
- Is there some explaination of why I can't get the previous version
  of that file?
Appreciate any light that could be shed on this.

Cheers, Erik

-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
Next: Jeff King
Message 1 of 8 in “Retrieving a file at a before a specified commit”
  1. Erik de Castro LopoMay 29, 2013
  2. Jeff KingMay 29, 2013
  3. Erik de Castro LopoMay 30, 2013
  4. Erik de Castro LopoMay 30, 2013
  5. Junio C HamanoMay 30, 2013
  6. Erik de Castro LopoMay 30, 2013
  7. Jeff KingMay 30, 2013
  8. Erik de Castro LopoMay 30, 2013

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.