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

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

Run

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

我真的需要在每次更新应用服务器时设置简单的git pull origin master吗?是否有任何方法来覆盖这种行为,以便在没有设置姓名和电子邮件时不会出错?


当前回答

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

其他回答

我使用Jenkins,在尝试执行释放(需要git提交)时遇到了这个问题。为了解决这个问题,我需要添加一个自定义用户名/电子邮件地址(见图),这确保当代码签出时,它在执行发布时使用我的构建用户名/电子邮件地址。注意,此配置可从Jenkins Multibranch Pipeline项目配置中获得。

我犯了个错误 我在本地设置了响应。对于回购

git config --local user.email "AppServer@your_domain.something"
#git config --local ...
git stash
#optionally unset to minimize risk of fake user commits ...
#esp if someone other than you uses the repo too
git config --local --unset user.email
#git config --local --unset ...

我没有git拉的错误,所以我不能测试这是否会有帮助,然后

另请参阅

git配置的优先级是什么?

我的Git配置中的设置是从哪里来的?

无法自动检测电子邮件地址。

默认情况下,它采用您的系统用户名,如abc@xyz.none。

所以你需要像下面这样设置你的邮箱:

git config user.email "someone@gmail.com"

设置email后,你可以运行git命令并提交你的更改。

git init Git add * Git commit -m "some init msg"

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

这对我来说很有效。

如果你发现旧的默认行为很有用(即使用本地用户名和主机名作为作者标识,而不是识别你的人),你可以运行:

git config --global user.name "$USER" && git config --global user.email "$USER@$HOSTNAME"