This is not a complete solution to your question, as the commit date is still updated (this does change the commit after all), but it might be suitable for anyone that just wants to keep the author date unchanged.
Rather than using --reset-author
with also updates the author date, you can just set the author explicitly.
git rebase --root --exec "git commit --amend --author=John --no-edit"
You can specify what you want as the author explicitly, or use a use a search pattern (which is what the example above does).
--author=
Override the commit author. Specify an explicit author using the standard A U Thor format. Otherwise is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=); the commit author is then copied from the first such commit found.
Source
--env-filter
– Rodifilter-branch
aprroach. I'm pretty sure it does help, because I did solve a similar problem a while ago. I could provide an exact solution if I knew all the circumstances of your task, particularly how many commits you need to rewrite, ow many branches and so on... – Rodi