如何修复没有身份识别的损坏的git修订版?

时间:2014-06-27 04:07:34

标签: git github-for-windows

我有一个包含大量修订的git存储库。我是唯一的开发人员,所以到目前为止所有的提交都来自我。不知何故,我最终得到了一个没有身份信息的提交。我试过跑:

git filter-branch --env-filter '
>> GIT_AUTHOR_NAME=myusername
>> GIT_AUTHOR_EMAIL=myuseremail@website.com
>> export GIT_AUTHOR_NAME
>> export GIT_AUTHOR_EMAIL

但我一直收到这个错误:

rewrite deadbeefdeadbeefdeadbeefdeadbeefdeadbeef (112/123)fatal: empty ident name (for ()) not allowed
could not write rewritten commit
rm: cannot remove '/c/some/directory/that/leads/to/my/repository/.git-rewrite/revs': Permission denied
rm: cannot remove directory '/c/some/directory/that/leads/to/my/repository/.git-rewrite': Directory is empty
我做错了什么?我在网上看到的关于ident的所有内容都告诉你如何在提交之前修复提交:提交之后你做了什么?

1 个答案:

答案 0 :(得分:1)

可以肯定的是,我会设置AUTHOR COMMITTER,并使用git commit-tree来记录更改。

您可以在" Change the author of a commit in Git"。

中看到完整的示例

注意:要重置过滤器分支,您可能需要:

  • 退出你的git bash
  • 删除.git-rewrite文件夹。