git - 为什么 Git 即使在配置之后也不允许我提交?

标签 git github commit config

这个问题似乎是重复的,但实际上不是。只是不断重复的细微差别。 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

最佳答案

这是一个错字。您在 ema​​il 中不小心设置了没有 euser.mail。通过在全局配置中设置 user.email 来修复它

git config --global user.email "you@example.com"

关于git - 为什么 Git 即使在配置之后也不允许我提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14662526/

相关文章:

windows - git config pack.packSizeLimit 的上限?

windows - 什么是 Git 的好(免费)可视化 merge 工具? (在 window 上)

git - 我如何从 Git 中的另一台计算机的存储库中提取?

node.js - Nodegit 创建远程存储库并进行第一次推送

GitHub 高级搜索默认行为

eclipse - 如何在 Eclipse Subclipse/subversion SVN 中输入凭据?

mercurial - 如何在 Mercurial 中验证和强制执行提交消息?

git - 限制 GitHub 或 Bitbucket 存储库的访问

github - 通过 GitHub API 删除多个问题/公关评论

python - 连接到 mercurial pretxncommit。并且不能导入请求模块?