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

Re: How to set git commit timestamp

From
Shawn O. Pearce <spearce@spearce.org>
Date
May 8, 2007, 01:38 UTC
Message-ID
<20070508013833.GB11311@spearce.org>
In-Reply-To
<200705062151.40261.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 10 quoted lines
> söndag 06 maj 2007 skrev Guido Ostkamp:
> > 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).
> 
> If you are writing a converter then you should really use the plumbing 
> commands rather than porcelains like git-commit and in particular you should 
> look at git-fast-import for a  really fast methord of importing (and packing) 
> objects.

As the author of a few convert-to-git things, fast-import really is the easiest way to import stuff into git, even if it doesn't need to be "fast". The input format is quite simple to create, and is documented pretty heavily in the git-fast-import manual page.

There's also contrib/fast-import/import-tars.pl which handles decompressing and importing one or more tar files into a Git repository. Works pretty well...

So I agree with Robin, give fast-import a try.
-- 
Shawn.
Previous: Robin RosenbergNext: Jakub Narebski
Message 5 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.