git commit broken time zone

906 views Asked by At
> git fsck
error in commit %hash%: invalid author/committer line - bad time zone

> git show %hash%
Date: Mon Mar 18 23:57:14 2201 -5274361

How this can be fixed? With git rebase in master branch and delete\update commit info, or do some magic in project .git directory, or somehow else?

2

There are 2 answers

1
a1pancakes On BEST ANSWER

I'd go for the git rebase -i solution.

Edit the wrong commits and git commit --amend --date="Mon Jul 24 14:00 2015 +0100" when you stop on them.

If you rebase on pushed commits, you'll have to rewrite the branch history (in your case master) by doing a push -f.

0
Pogrindis On

EDIT: If the rebase option does not work.. I would write off trying to repair the repo..

I would go with a fast export and fast import..

git fast-export --all | (cd /cleanrepo/ && git fast-import)

I would add the --anonymize to remove all identifying info if the above fails..