Git:“请告诉我你是谁”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11656761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 14:13:42  来源:igfitidea点击:

Git: "please tell me who you are" error

git

提问by randombits

I have app servers that I bootstrap together using Chef + some ad-hoc bash scripts. The problem is, when I want to run an update on one of these app servers, I get:

我有使用 Chef + 一些临时 bash 脚本引导的应用服务器。问题是,当我想在这些应用服务器之一上运行更新时,我得到:

19:00:28: *** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

Do I really need to set this for doing a simple git pull origin masterevery time I update an app server? Is there anyway to override this behavior so it doesn't error out when name and email are not set?

git pull origin master每次更新应用服务器时,我真的需要设置它来做一个简单的事情吗?无论如何要覆盖此行为,以便在未设置名称和电子邮件时不会出错?

回答by luxuia

I spend on it lots hours when i call php script to init and commit git. And i Found the work flow should Be:

当我调用 php 脚本来初始化和提交 git 时,我花了很多时间。我发现工作流程应该是:

1.git init
2.git config user.name "someone"
3.git config user.email "[email protected]"
4.git add *
5.git commit -m "some init msg"

If you swap [23] and 1, the config will not work at all.

如果您交换 [23] 和 1,配置将根本不起作用。

Wish this will do some help.

希望这会有所帮助。

回答by gfxmonk

Instead of doing a git pull, you can do:

git pull您可以执行以下操作,而不是执行 a :

git fetch
git reset --hard origin/master

Neither of those require you to configure your git user name / email.

这些都不需要您配置您的 git 用户名/电子邮件。

This will destroy any uncommitted local changes / commits, and will leave your HEAD pointing to a commit (not a branch). But neither of those should be a problem for an app server since you shouldn't be making local changes or committing to that repository.

这将破坏任何未提交的本地更改/提交,并使您的 HEAD 指向提交(而不是分支)。但是对于应用服务器来说,这些都不应该是问题,因为您不应该进行本地更改或提交到该存储库。

回答by DoronK

If you are using sourcetree: Repository -> Repository Settings --> Advanced --> uncheck "Use global user settings" box

如果您使用的是 sourcetree:存储库 -> 存储库设置 --> 高级 --> 取消选中“使用全局用户设置”框

worked great for me.

对我很有用。

回答by Kuldeep Singh

it works for me, try This.. you need to configure your terminal with remote access.

它对我有用,试试这个..你需要用远程访问配置你的终端。

     git config --global user.name "abc"
     git config --global user.email "[email protected]"

回答by twalberg

Update your bootstrap process to create a ${HOME}/.gitconfigwith the proper contents, or to copy an existing one from somewhere.

更新您的引导程序以创建${HOME}/.gitconfig具有正确内容的引导程序,或从某处复制现有的引导程序。

回答by MrRobot4.0

git config user.email "insert github email here"
git config user.name "insert github real name here"

This worked great for me.

这对我很有用。

回答by Rahul

Same issue was with me and resolved it by adding default name and email Repository Settings.

我遇到了同样的问题,并通过添加默认名称和电子邮件存储库设置来解决它。

As Doron suggested -

正如多伦所建议的——

If you are using sourcetree: Repository -> Repository Settings --> Advanced --> uncheck "Use global user settings" box.

如果您使用的是 sourcetree:存储库 -> 存储库设置 --> 高级 --> 取消选中“使用全局用户设置”框。

Add default name and email address.

添加默认名称和电子邮件地址。

回答by Mo-Gang

In my case I was missing "e" on the word "email" as Chad stated above but I see its not the case with you. Please hit the following command to see if everything is pulling as expected.

在我的情况下,正如乍得所说,我在“电子邮件”一词中遗漏了“e”,但我认为您的情况并非如此。请点击以下命令,看看是否一切都按预期进行。

git config -l

回答by Abu Bakr

You must Write Your email like that

你必须像那样写你的电子邮件

 git config --global user.email "[email protected]"

Then: Write Username

然后:写用户名

 git config --global user.name "Your Name"

After That Poupup window will appear

在那个弹出窗口出现之后

Write USERNAME & EMAILFor Acount YOU want contribute

为您想要贡献的帐户写下用户名和电子邮件

回答by Sharukh Mastan

For me the issue was network connection, once I reconnected to my wifi, it could fetch the details and commit without any issues.

对我来说,问题是网络连接,一旦我重新连接到我的 wifi,它就可以获取详细信息并提交而没有任何问题。