Video in progress

Strong Middle 🌿 Git

A commit has two kinds of information: author and committer. When do they differ, and why does the commit date change after a rebase?

The author is the person and time that wrote the change, and the committer is the person and time that created the commit in its current form. Rebase, cherry-pick and amend recreate the commit: the author is kept, and the committer and its date are updated.

📖 Answer

git log -3 --format='%h  author: %an %ad  |  committer: %cn %cd' --date=short
# 9f1e2d3  author: Aziz 2026-10-20  |  committer: Aziz 2026-11-02
# 4c5b6a7  author: Dilnoza 2026-10-28  |  committer: GitHub 2026-10-28

When they differ:

  • you rebased your own branch: the author date is old, the committer date is today;
  • you cherry-picked a colleague's commit onto a release branch: he is the author, you are the committer;
  • the platform merged the PR in its web interface: the committer is often the platform itself.

By default git log shows the author date, but the committer date is used for ordering (--date-order) and in some tools. That is why after a rebase an "old" commit can look as if it appeared at a new place in the history.

To control it:

git commit --amend --reset-author --no-edit   # author becomes you, at the current time
git rebase --committer-date-is-author-date origin/main

For old commits made with a wrong email, you do not have to rewrite history: a .mailmap file in the repo root merges names/emails in git log and git shortlog:

Aziz Karimov <aziz@shop.uz> <aziz.k@gmail.com>

In pair programming, the second person is added with a Co-authored-by: Name <email> line at the end of the message. Git treats it as plain text, but GitHub and GitLab recognize it.

Account for this in metrics (lead time) too: the author date shows "when the work started", while the committer date often shows "when the last rebase was".