I want to make a rebase to remove a certain commit from my history. I know how to do that. However if I do it, the commit timestamp is set to the moment I completed the rebase. I want the commits to keep the timestamp.
I saw the last answer here: https://stackoverflow.com/a/19522951/3995351 , however it didn't work.
The last important command just showed a new line with
>
So I am opening a new question.
So, here is a tedious way to do it (depending on how many commits you need to rebase), but I tried it out and it works. When you do an interactive rebase, mark each commit with "e" so that you can edit it. This will cause git to pause after every commit. At each pause, you can specify which date to use and continue to the next commit with:
Or if you want to keep the committer and author date the same:
Add
--no-editafter--amend, if you don't want the editor to open to change the commit.This is, of course, a major pain in the rear, and you have to know all of the commit dates before hand, but if you can't do it any other way, it at least should work.