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

Re: File version at a specific date?

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 31, 2006, 18:24 UTC
Message-ID
<ealhrj$pdo$1@sea.gmane.org>
In-Reply-To
<200607311956.00679.Alexander.Zvyagin@cern.ch>
Alexander ZVYAGIN wrote:
Show 9 quoted lines
> I failed to find in the documentation how to look to a file content
> at some moment in a past.
> 
> Something like this:
> $ git checkout master~2 Makefile
> when I specify not the revisions numbers ago the file was (~2),
> but the time, for example "2005-12-12 00:00:00" or something like this.
> 
> Where should I look at?

Either use git rev-list with --since=datestring, --after=datestring, --until=datestring, --before=datestring to find a commit, or if you have reflog enabled (you have .git/logs/refs/) you can use @{date} syntax, see 'man git-rev-parse'

"A suffix @ followed by a date specification enclosed in a brace pair  (e.g.
 {yesterday},  {1  month  2 weeks 3 days 1 hour 1 second ago} or {1979-02-26
 18:30:00}) to specify the value of the ref at a prior point in  time.  This
 suffix  may  only be used immediately following a ref name and the ref must
 have an existing log ($GIT_DIR/logs/<ref>)."
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Alexander ZVYAGINNext: Shawn Pearce
Message 2 of 3 in “File version at a specific date?”
  1. Alexander ZVYAGINJul 31, 2006
  2. Jakub NarebskiJul 31, 2006
  3. Shawn PearceJul 31, 2006

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.