I recently rebased my most recent commits to my master branch interactively (rebase -i
). I squashed multiple commits into just two, discarding unneeded commit messages (fixup
), and subsequently pushed to remote master (on GitHub).
What I noticed is that the commit dates in the remote repo does not correspond to the date of the commit (as provided by git log
). Rather the commit dates on the remote branch correspond to the date of rebasing and pushing. From what I can find, the commit history on the remote repo is supposed to correspond to the local one, but the commit dates in my remote and local branch are divergent. I can only assume this has something to do with rebasing, and that my original commits where tampered with.
Output from git log
:
% git log
commit 09e76b90aa1c0c3f6a780c8b29b0c93dc2f57143 (HEAD -> master, origin/master)
Author: John Doe <john@doe.com>
Date: Wed Apr 12 13:23:12 2023 +0200
1st imputation success no interaction or random sl
commit 2ef860eabd90dfff5197c66a3dbb541174e1146b
Author: John Doe <john@doe.com>
Date: Thu Mar 9 22:32:49 2023 +0800
First commit on Arch Linux
History on GitHub:
- Why do the commit dates on the local and remote branch diverge?
- Is there a way to change Git/GitHub's behaviour so that the commit dates correspond?