Github commit log timestamps messed up after a rebase

After a git rebase and git push -f all commit timestamp on github became the time I complete the rebase, instead of the actual original time of the commits.

link to the problematic repo

Can confirm it’s a Github thing because the commit log appears to be correct in my local repository and other git hosting services.

Is there a way to fix this?

It seems Github uses the commit date, not the author date, for the timestamp. If you look at git log --pretty=fuller you’ll see both. If you make a new commit they will be the same, but by default git rebase will reset the commit date to the time of the rebase because effectively a new commit with the same content is created. The --committer-date-is-author-date option should change that, but I haven’t tried it myself, so tread carefully. :smiley_cat:

1 Like

Thank you! Didn’t know about the concept of commit date vs. author date before. Yes --committer-date-is-author-date seems to work here, all good now :D.

1 Like

Thank you for the confirmation! :smile_cat: