这个问题似乎是重复的,但实际上不是。只是不断重复的细微差别。 git 一直告诉我:“请告诉我你是谁”,即使在设置之后也是如此。当我运行 git commit
时,这就是我得到的......
$ git commit
*** 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: unable to auto-detect email address (got 'Obby@ObbyWorkstation.(none)')
但是当我运行 git config --global -l
时,它会提供我所有的详细信息...
$ git config --global -l
user.name=myname
user.mail=me.myself@gmail.com
http.proxy=proxy.XX.XX.XX:XXXX
我已经更改了我的名字、电子邮件和代理,但当我运行命令时它们显示正常,即使在 .gitconfig 文件中我也可以看到这些值已设置。可能缺少什么,因为我根本无法 promise 。每次它一直问我我是谁?
@sheu 告诉我一些我改变的事情,但仍然是同样的问题。当我设置 --local
时,git commit
仍然问我同样的问题。这是输出
$ git config --local -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
user.name=myname
user.mail=me.myself@gmail.com
最佳答案
这是一个错字。您在 email 中不小心设置了没有 e 的 user.mail
。通过在全局配置中设置 user.email
来修复它
git config --global user.email "you@example.com"
关于git - 为什么 Git 即使在配置之后也不允许我提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14662526/