How to change git commit dates
This tutorial shows how to bulk edit git commit timestamps and author metadata
without interactive rebase or filter-branch shell scripts.
When you need this
- Commits show UTC timestamps from a CI runner instead of your local timezone
- Laptop clock drift left a block of commits at the wrong time
- Author email or name is wrong across many commits on a feature branch
- You want to review every date change in a spreadsheet before rewriting history
Step 1 — Export the branch
From your repo, on the branch you want to rewrite:
git-edit-date export -o commits.csv
This exports the current branch history (git rev-list --reverse HEAD)
to a CSV file. Only commits reachable from HEAD are included.
Step 2 — Edit the CSV
Open commits.csv in Excel, LibreOffice Calc, or any spreadsheet editor.
CSV columns
hash— original commit SHA (reference only; do not edit)author_name— commit author display nameauthor_email— commit author emailauthor_date— when the work was originally done (RFC3339)committer_date— when the commit object was created (RFC3339)message— commit message (reference only; not changed on apply)
Dates use RFC3339 format, for example 2024-03-05T14:30:00+01:00.
In most cases you want author_date and committer_date to match.
See the FAQ on author date vs committer date.
author_email,author_date,committer_date
[email protected],2024-03-06T03:14:00Z,2024-03-06T03:14:00Z
author_email,author_date,committer_date
[email protected],2024-03-05T14:30:00+01:00,2024-03-05T14:30:00+01:00
You can edit only some rows — unchanged rows keep their original metadata. Save the file as CSV when done.
Step 3 — Apply and push
Apply requires a clean working tree unless you pass -allow-dirty:
git-edit-date apply -file=commits.csv
Verify the result:
git log --format=fuller -3
If the branch was already pushed, update the remote safely:
git push --force-with-lease
Safe push checklist
- Confirm you are on the correct branch (
git branch --show-current) - Make sure no one else is actively pushing to this branch
- Use
--force-with-lease, not bare--force - Never rewrite shared or protected branches without team agreement
- Expect GPG signatures on rewritten commits to become invalid
Install git-edit-date
curl -LO https://giteditdate.com/git-edit-date_amd64.deb
sudo dpkg -i git-edit-date_amd64.deb
Command reference: CLI docs · Common questions: FAQ · Alternatives: compare with rebase and filter-branch