2014-06-27 48 views
1

我有一個有很多修訂的git倉庫。我是唯一的開發者,所以所有提交都是從我這裏得到的。不知何故,我結束了一個沒有身份信息的提交。我試圖運行:如何修復沒有標識的破壞的git修訂版?

git filter-branch --env-filter ' 
>> GIT_AUTHOR_NAME=myusername 
>> [email protected] 
>> 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的所有內容都告訴你如何在提交之前修正提交問題:提交已經通過了,你做了什麼?

+0

我不知道這是否有幫助,但你檢查了本頁的最後一節:[git-book](http://git-scm.com/book/en/Git-工具重寫-歷史)?它談到提交後更改電子郵件。 –

回答

1

可以肯定,我會設置作者 COMMITTER,並使用git commit-tree來記錄更改。

您可以在「Change the author of a commit in Git」中看到完整示例。

注:重置您的過濾分支,您可能需要:

  • 退出你的Git的bash
  • 刪除.git-rewrite文件夾。