Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Git'中设置名称和电子邮件;但是Git仍然使用默认生成的名称和电子邮件_Git_Config - Fatal编程技术网

在Git'中设置名称和电子邮件;但是Git仍然使用默认生成的名称和电子邮件

在Git'中设置名称和电子邮件;但是Git仍然使用默认生成的名称和电子邮件,git,config,Git,Config,标题说明了这一点,但我将更详细地解释: 我已按照建议使用以下命令配置了我的用户名和电子邮件: git config --global user.name git config --global user.email 我可以通过执行git config--global--list验证是否设置了此选项,并得到以下输出: core.user=Joshua Guerra core.email=joshua@allianceconsults.net core.editor=nano push.defau

标题说明了这一点,但我将更详细地解释:

我已按照建议使用以下命令配置了我的用户名和电子邮件:

git config --global user.name
git config --global user.email
我可以通过执行
git config--global--list
验证是否设置了此选项,并得到以下输出:

core.user=Joshua Guerra
core.email=joshua@allianceconsults.net
core.editor=nano
push.default=simple
我还可以通过执行
cat~/.gitconfig
进行验证,其中输出为:

# This is Git's per-user configuration file.
[core]
# Please adapt and uncomment the following lines:
user = Joshua Guerra
email = joshua@allianceconsults.net
[core]
    editor = nano
[push]
    default = simple
因此,我已验证它设置正确。但是,当我提交时,仍然会收到一条信息,上面写着:

Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com
在你说之前,这只是为将来的提交设置值,请理解我理解这一点。另外,我设置了这个,并且反复得到这样一条消息,即即使在我设置了这些值之后,这些值也没有设置,并且每次在我提交某些内容时都验证了这些值的设置


我不明白为什么我的系统一直给我这个信息。如果您需要有关我使用的版本和系统的更多信息,我很乐意根据要求提供。

~/.gitconfig
email
设置应出现在
[user]
部分。它们设置不正确。运行以下命令可能会导致您的
~/.gitconfig

git config --global core.user "Joshua Guerra"
git config --global core.email joshua@allianceconsults.net
应该运行的命令包括:

git config --global user.name "Joshua Guerra"
git config --global user.email joshua@allianceconsults.net
要验证设置是否正确,请运行git config--global--list
并检查输出:

...
user.name=Joshua Guerra
user.email=joshua@allianceconsults.net
...

我发现我没有像我想的那样仔细阅读我所做的事情。唉。谢谢你的帮助