Reputation: 113
I want to change date of 4 commits that I pushed to github today, say pushing them back by 3 dates.
I have 2 problems, and it seems that they are relevant:
Is there anyway I can fix this?
Upvotes: 1
Views: 1352
Reputation: 1328522
You should use a git rebase -i --committer-date-is-author-date --ignore-date
(with Git 2.29+, Q4 2020) when changing your date.
If not, the committer date would be today (IE, by default, the date when the rebase was done).
Or you can also use git filter-repo
, as in this example, except the code would need (as in this gist)
commit.author_date = commit.committer_date = new_date.encode('utf-8')
Meaning filter-repo needs, in its callback, to change the author and committer date.
Upvotes: 2