为什么 Git 不允许我在配置后提交? [英] Why Git is not allowing me to commit even after configuration?

查看:36
本文介绍了为什么 Git 不允许我在配置后提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题似乎是重复的,但实际上不是.只是不断重复的微小差异.git 一直告诉我:请告诉我你是谁",即使在设置之后也是如此.当我运行 git commit 时,这就是我得到的......

This question seems like a duplicate but it's really not. Just a slight difference that keeps on repeating. git keeps on telling me: "please tell me who you are", even after setting it up. when I run git commit, this is what I get....

$ 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 时,它会提供我所有的详细信息...

But when I run git config --global -l, it gives me all my details...

$ git config --global -l
user.name=myname
user.mail=me.myself@gmail.com
http.proxy=proxy.XX.XX.XX:XXXX

我已经更改了我的姓名、电子邮件和代理,但是当我运行命令时它们看起来很好,即使在 .gitconfig 文件中我也可以看到设置的值.可能缺少什么,因为我根本无法提交.每次都问我是谁?

I have changed my name, email and proxy but they are appearing fine when I run the command, even in the .gitconfig file I can see the values are set. what could be the missing thing, because I cannot commit at all. Every time it keeps asking me who I am ?

@sheu 告诉我一些我改变的东西,但仍然是同样的问题.当我设置 --local 时,git commit 仍然问我同样的问题.这是输出

@sheu told me something that i changed, but still the same problem. when i set --local, still git commit asks me the same question. this is the output

$ 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 中设置了 user.mail 没有 e.通过在全局配置中设置 user.email 来修复它

That’s a typo. You’ve accidently set user.mail with no e in email. Fix it by setting user.email in the global configuration with

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

这篇关于为什么 Git 不允许我在配置后提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆