Change the last git commit date
If only the tip commit has the wrong timestamp, git commit --amend
is enough. For older commits or many dates, use git-edit-date instead.
Amend the last commit date
GIT_AUTHOR_DATE='2024-03-05T14:30:00+01:00' \
GIT_COMMITTER_DATE='2024-03-05T14:30:00+01:00' \
git commit --amend --no-edit
This rewrites only HEAD. If that commit was already pushed, you still need
git push --force-with-lease.
When amend is not enough
- You need to change dates of multiple commits
- The wrong timestamps are not on the tip
- You want to review every change in a spreadsheet first
Then use the bulk CSV guide or the CLI tutorial. Tool comparison: when to use amend vs git-edit-date.
Also fix author on the tip?
Amend can change author with --author, but for branch-wide author date
fixes see change git author date.
↓ Download .deb v1.4
Linux amd64 · free
More: all guides · CLI tutorial · change git commit date