使用 git commit -m 的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38061542/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
trouble in using git commit -m
提问by Palak
When running git commit -m "Commit message"
It returns the error message:
运行时git commit -m "Commit message"
返回错误信息:
fatal: empty ident name (for ((null))) not allowed
致命:不允许空身份名称(for ((null)))
and then asks for the account's default identity.
然后询问帐户的默认身份。
See the command prompt screenshot for more details.
有关更多详细信息,请参阅命令提示符屏幕截图。
回答by Krzysztof Krasoń
Just as the text in the screenshot says, you need to tell git who are you committing the code as, by using e.g.:
正如屏幕截图中的文字所说,您需要告诉 git 您将代码提交给谁,例如:
git config --global user.name "John Smith"
git config --global user.email "[email protected]"