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

Re: How to set git commit timestamp

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
May 6, 2007, 17:26 UTC
Message-ID
<463E0FDE.3000504@lsrfire.ath.cx>
In-Reply-To
<Pine.LNX.4.64.0705061759210.8165@bianca.dialin.t-online.de>
Guido Ostkamp schrieb:
Show 8 quoted lines
> Hello,
> 
> does somebody know a method to specify a timestamp for a 'git commit'?
> 
> I am writing a tool to convert from another SCM to git and need to
> replay all checkins. I know how to set the log message and the author,
> but there appears to be no command option for the timestamp (Mercurial
> for example, has a 'hg commit -d date <file>' syntax for this).

You can use the environment variable GIT_COMMITTER_DATE to force a specific commit date. Please see the man page of git-commit-tree for (some) more info.

René
Previous: Alex RiesenNext: Robin Rosenberg
Message 3 of 9 in “How to set git commit timestamp”
  1. Guido OstkampMay 6, 2007
  2. Alex RiesenMay 6, 2007
  3. René ScharfeMay 6, 2007
  4. Robin RosenbergMay 6, 2007
  5. Shawn O. PearceMay 8, 2007
  6. Jakub NarebskiMay 8, 2007
  7. Shawn O. PearceMay 8, 2007
  8. Johannes SchindelinMay 8, 2007
  9. Jakub NarebskiMay 11, 2007

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.