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

Re: git rebase -i without altering the committer date

From
SJShaun Jackman <sjackman@gmail.com>
Date
Apr 20, 2016, 21:15 UTC
Message-ID
<etPan.5717f1cf.1fc1bca8.12d1@sjackman03-imac.phage.bcgsc.ca>
In-Reply-To
<xmqqd1pkuidw.fsf@gitster.mtv.corp.google.com>
On April 20, 2016 at 13:37:01, Junio C Hamano (gitster@pobox.com(mailto:gitster@pobox.com)) wrote:
Show 19 quoted lines
> Shaun Jackman writes: 
> 
> > I'd like to insert a commit between two commits without changing 
> > the committer date or author date of that commit or the subsequent 
> > commits. I'd planned on using `git rebase -i` to insert the 
> > commit. I believe it retains the author date, but changes the 
> > committer date to the current time. I've seen the options 
> > `--committer-date-is-author-date` and `--ignore-date`, but I don't 
> > believe either of those options does what I want. If no such 
> > option currently exists to leave the committer and author date 
> > unchanged, is there any chance that this functionality could 
> > please be implemented? 
> 
> You can mark the commit as "edit", use "git commit --amend" when 
> "rebase -i" stops and gives control back to you, and say "rebase 
> --continue". That way, you can use your favourite trick to lie 
> about committer date (or identity or other aspects) when running 
> "git commit --amend" and its effect will be left in the resulting 
> history, I would think. 
Thanks for the suggestion, Junio. That would retain the committer date for the commit being inserted. I believe that the subsequent commits would have their committer date modified to the current time by the `git rebase --continue`.

Cheers, Shaun

Previous: Junio C HamanoNext: Andreas Schwab
Message 3 of 6 in “git rebase -i without altering the committer date”
  1. Shaun JackmanApr 20, 2016
  2. Junio C HamanoApr 20, 2016
  3. Shaun JackmanApr 20, 2016
  4. Andreas SchwabApr 20, 2016
  5. Johannes SixtApr 21, 2016
  6. Johannes SchindelinApr 21, 2016

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.