Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
git filter-repo and amend commit date editing
// last commit
export GIT_COMMITTER_DATE="$(date -R --date="13 days ago")"; git commit --amend --date="$GIT_COMMITTER_DATE"
// selected dates
git filter-repo -f --commit-callback '
from datetime import datetime    96%  ─╯
d = commit.author_date.split()
date = datetime.fromtimestamp(int(d[0]))
if == 2:
commit.author_date = commit.committer_date = b" ".join(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment