【发布时间】:2019-04-24 07:43:55
【问题描述】:
我在 Chromebook 上使用 Linux 操作系统。我正在学习Java。我从 GitHub 下载了一个存储库。它缺少 .gitignore 文件,所以我创建了它并尝试提交它,但我收到一条消息
$ git commit -m "I've created .gitignore file"
*** Please tell me who you are.
Run
git 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 <(null)>) not allowed
我已经完成了,我输入了我的 GitHub 电子邮件,然后输入了我的名字和姓氏。
$ git config --global "my_GitHub_account_email@gmail.com"
$ git config --global "Name Surname"
但是当我输入我的名字时,我会收到一条消息:
error: key does not contain a section: Name Surname
我做错了什么?
【问题讨论】:
-
你能用你输入的实际命令更新你的问题吗?
-
你能看一下你的 .gitconfig 看看它的格式是否正确吗?
-
$ cat .gitignore /bin/ .idea/* .classpath* .project* *.iml
-
我从来没有使用过Linux系统,我所做的一切都是我在google上搜索的。我按照课程视频中的所有步骤进行操作。我还尝试创建一个文本文件 abc.txt。它仍然带来同样的错误。
标签: git