1

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:

  1. I use git rebase to fix the date of commits, but when I pushed them to github, the final commit will be labled today. enter image description here
  1. The public github page will still show the change I made as today.

Is there anyway I can fix this?

VEvergarden
  • 105
  • 11

1 Answers1

2

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250