Vladimir Cvetic
Vladimir Cvetic

Reputation: 842

GIT Repository: "invalid author/committer line - missing space before date"

When trying to make a move to github from bitbucket I've encountered fatal error in one of commits:

error in commit d8b1774aa7bd98c6494a1e31acef943d0e0cbf03: missingSpaceBeforeDate: invalid author/committer line - missing space before date

cat-file shows:

author john <[email protected]>removed backup files. Modified  <> 1397201439 +0200
committer john <[email protected]> 1397201439 +0200

How can I amend this commit and add missing space?

Upvotes: 2

Views: 1787

Answers (2)

Razzle
Razzle

Reputation: 21

Had the same error. Solved it by deleting the tags associated with the problematic commits (did not need the tags anyway) and then mirroring the repo.

git tag -d TAGNAME

I was able to list the problematic commits with the following command:

git fsck

Upvotes: 0

Vladimir Cvetic
Vladimir Cvetic

Reputation: 842

Solved the issue with:

git filter-branch --env-filter \
'if [ $GIT_COMMIT = d8b1774aa7bd98c6494a1e31acef943d0e0cbf03 ]
 then
     export GIT_AUTHOR_NAME="John"
     export GIT_AUTHOR_DATE="Fri, 11 Apr 2014 07:30:39 +0000"
     export GIT_COMMITTER_DATE="Fri, 11 Apr 2014 07:30:39 +0000"
     export GIT_AUTHOR_EMAIL="[email protected]"
 fi' --tag-name-filter cat -- --branches --tags

Upvotes: 5

Related Questions