git-edit-date

How do I edit git commit dates?

Wrong timezone, a clock that drifted, commits under the wrong name — and suddenly you’re fighting filter-branch at midnight. I built a small CLI so you don’t have to.

Export the branch to CSV, tweak author and timestamps in Excel or LibreOffice, apply the rewrite in one command.

Download .deb Linux amd64 · free

Example

Say your log looks like this — wrong email, timestamps in UTC at 3 am:

Before · git log
a1b2c3d  Alice <[email protected]>  2024-03-06 03:14 +0000  Fix login
e4f5a6b  Alice <[email protected]>  2024-03-06 03:15 +0000  Add tests
After · git log
9f8e7d6  Alice <[email protected]>  2024-03-05 14:30 +0100  Fix login
c5b4a39  Alice <[email protected]>  2024-03-05 15:00 +0100  Add tests

What changed: author email and dates. Messages stay the same; commit hashes are new (history rewrite).

How

1. Export the current branch:

git-edit-date export -o commits.csv

2. Open the CSV and fix the fields you care about:

Before · commits.csv
author_email,author_date,committer_date
[email protected],2024-03-06T03:14:00Z,2024-03-06T03:14:00Z
[email protected],2024-03-06T03:15:00Z,2024-03-06T03:15:00Z
After · commits.csv
author_email,author_date,committer_date
[email protected],2024-03-05T14:30:00+01:00,2024-03-05T14:30:00+01:00
[email protected],2024-03-05T15:00:00+01:00,2024-03-05T15:00:00+01:00

3. Apply and push:

git-edit-date apply -file=commits.csv
git push --force-with-lease

Install

curl -LO http://giteditdate.com/git-edit-date_amd64.deb
sudo dpkg -i git-edit-date_amd64.deb

Heads up