2012-01-29 91 views
5

我使用的Git在Windows上,並設置用戶名和電子郵件:不正確的Git用戶名和電子郵件在Windows

git config --global user.name "hydRAnger" 
git config --global user.email "[email protected]" 

當我使用:

git config --global --list 

我得到的輸出:

user.name=hydRAnger
[email protected]

但是,當我使用git log作者信息應該是:

Author: hydRAnger <[email protected]>

但事實上我得到的輸出:

Author: unknown <[email protected](none)>

我不知道爲什麼作者信息incorect。

回答

6

設置user.nameuser.email配置選項不改變現有的提交。它只適用於未來的承諾。

如果你也想重寫現有的提交以使用新的用戶數據看看這個問題:

Change the author and committer name and e-mail of multiple commits in Git

+0

非常感謝。這個答案的工作原理: http://stackoverflow.com/a/750191/1054306 – hydRAnger 2012-01-29 14:53:34

+0

另請參見[有沒有一種方法來覆蓋git作者的顯示名稱](http://stackoverflow.com/q/8878615/11343)for另一種方法來做到這一點 – CharlesB 2012-01-30 13:02:59

3

在更新您的詳細信息後,您是否重置提交作者?

git commit --amend --reset-author 

(這將再次彈出提交信息 - 你可以把它完好)

+0

感謝,但是當我使用:git的承諾--amend --reset-作者 我got:error:Terminal is dumb,but EDITOR unset 請使用-m或-F選項提供消息。 – hydRAnger 2012-01-29 14:29:37

+2

聽起來像你正在使用常規的cmd.exe shell而不是msysgit bash – ThiefMaster 2012-01-29 14:47:58

+1

嘗試'git commit --amend --reset-author -m「'' – 2012-01-29 14:48:34

相關問題