使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:19:06  来源:igfitidea点击:

trouble in using git commit -m

git

提问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]"

回答by toro

You need to set your user name and email address, which sets your identity before you can commit anything. Please follow the instructions here.

您需要设置您的用户名和电子邮件地址,这会在您提交任何内容之前设置您的身份。请按照此处的说明操作。