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

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

问题描述

这个问题似乎是重复的,但事实并非如此。只是稍有不同,不断重复。 git不断告诉我:请告诉我你是谁,即使设置完成。当我运行 git commit 时,这就是我得到的结果....

  $ git commit 

***请告诉我你是谁。

运行

git config --global user.emailyou@example.com

git config --global user.nameYour命名

来设置您帐户的默认身份。
省略--global仅在此存储库中设置标识。

致命:无法自动检测电子邮件地址(得到'Obby @ ObbyWorkstation。(none)')

但是当我运行 git config --global -l <​​/ code>,它给了我所有的细节......

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

我改变了我的名字,电子邮件和代理服务器,但它们在我运行该命令时显示正常,即使在.gitconfig文件中,我也可以看到这些值已设置。什么可能是失踪的事情,因为我根本无法承诺。每次它不断问我是谁?

@sheu告诉我一些我改变的东西,但仍然是同样的问题。当我设置 - 本地,仍然 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


解决方案

这是一个错字。您意外地设置了 user.mail 而没有 e 。通过在全局配置中设置 user.email 来修复它,方法是使用

  git config --global user.emailyou@example.com


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)')

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

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

解决方案

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

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

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

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