当尝试从bitbucket转移到github时,我在其中一个提交中遇到了致命错误:
error in commit d8b1774aa7bd98c6494a1e31acef943d0e0cbf03: missingSpaceBeforeDate: invalid author/committer line - missing space before date
cat-file
显示:
author john <john@doe.com>removed backup files. Modified <> 1397201439 +0200
committer john <john@doe.com> 1397201439 +0200
如何修改此提交并添加缺少的空间?
答案 0 :(得分:0)
解决了问题:
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="john.doe@blah.com"
fi' --tag-name-filter cat -- --branches --tags