简体   繁体   中英

Change date of commits on github

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. 在此处输入图像描述
  1. The public github page will still show the change I made as today.

Is there anyway I can fix this?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM