The committer date (%ci
) keeps being reset, even if the commit author date (%ai
) remains the same:
For instance, if I commit --amend -no-edit the last commit on the Git repo, the author date remains unchanged, but I just created a new commit: replacing the old one with the same content, but a different commit date:
P:\git\git>git show -s --format="%ci" e0d6576639261beefb40afa52696d02f16c490ed
2012-12-11 03:42:23 +0100 <== just now
P:\git\git>git show -s --format="%ai" e0d6576639261beefb40afa52696d02f16c490ed
2012-12-07 14:18:55 -0800 <== original date when the author did commit
So any amend will result in a different SHA1.
From the Pro-Book:
- The author is the person who originally wrote the work,
- whereas the committer is the person who last applied the work.
A commit --amend
will always recreate a new commit, if only because the committer date is changing.