Last active
April 15, 2020 02:43
-
-
Save JuniorJPDJ/77c8a6bad05e6e0205c5edee03ce978c to your computer and use it in GitHub Desktop.
git filter-repo and amend commit date editing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 46.175.47.49 96% ─╯ | |
d = commit.author_date.split() | |
date = datetime.fromtimestamp(int(d[0])) | |
if date.day == 2: | |
d[0]=str(int(d[0])+12*60*60).encode("ascii") | |
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