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

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

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.

Before
author_email,author_date,committer_date
[email protected],2024-03-06T03:14:00Z,2024-03-06T03:14:00Z
After
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

  1. Confirm you are on the correct branch (git branch --show-current)
  2. Make sure no one else is actively pushing to this branch
  3. Use --force-with-lease, not bare --force
  4. Never rewrite shared or protected branches without team agreement
  5. 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