今天安裝好git后,創建新項目,當git上傳提交時出現了一個問題,如下:
Commit failed - exit code 128 received, with output: '*** Please tell me who you are.Rungit config --global user.email "you@example.com"git config --global user.name "Your Name"to set your account's default identity.
Omit --global to set the identity only in this repository.fatal: empty ident name (for <>) not allowed'
提示:Please tell me who you are.
翻譯過來就是:請告訴我你是誰。
就是說這里git無法識別你是誰,你需要告訴 git 你的身份。
其實提示已經告訴了你的問題:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
所以我找到的 解決辦法是在 終端 || 命令行 輸入你的郵箱與名稱:
git config --global user.email "郵箱"
git config --global user.name "名稱"
在命令行輸入回車之后,發現不會出現這個問題了。
注意:git config命令的–global參數,用了這個參數,表示你這臺機器上所有的Git倉庫都會使用這個配置,當然也可以對某個倉庫指定不同的用戶名和Email地址。
你也可以通過以下命令來查看你的配置信息:
git config -l
總的來說:這是因為Git是分布式版本控制系統,所以,它必須要識別于你來自哪一個身份:你的名字和郵箱地址。