I am working on a github hosted project. For testing reasons, I have to move my computer date to somewhere in the future (2012) and forgot to bring it back to normal time when doing a git commit / push.
The actual commit is now actually saved as 2012 instead of 2010 and it's screwing our github view since they always appear on top.
Is there any way to fix that?
There are many ways to rewrite history with git. Use git commit --amend to change your latest log message. Use git commit --amend to make modifications to the most recent commit. Use git rebase to combine commits and modify history of a branch.
You can always change a date on your computer, make a commit, then change the date back and push.
Click History. Right-click the commit you want to revert and click Revert Changes in Commit.
If not too many people have already pulled from that GitHub repo, you could locally change the GIT_AUTHOR_DATE
and GIT_COMMITTER_DATE
of your old commit, and git push --force
that to the GitHub repo.
(Just be prepared to point out people to the RECOVERING FROM UPSTREAM REBASE section of the git rebase
man page)
See How can one change the timestamp of an old commit in Git? for the specifics on the git filter-branch
command required for that kind of operation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With