我有应用程序服务器,我使用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吗?是否有任何方法来覆盖这种行为,以便在没有设置姓名和电子邮件时不会出错?


当前回答

Git pull不需要这个。 然而,如果拉操作导致合并冲突,那么它似乎是必要的。

其他回答

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

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配置中的设置是从哪里来的?

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

     git config --global user.name "abc"
     git config --global user.email "abc@example.com"

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

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

这对我来说很有效。

恕我冒昧,解决这个错误的正确方法是配置你的全局git配置文件。

执行以下命令:git config——global -e

将出现一个编辑器,您可以在其中插入默认的git配置。

以下是一些例子:

[user]
    name = your_username
    email = your_username@users.noreply.github.com 
[alias]
    # BASIC
    st = status
    ci = commit
    br = branch
    co = checkout
    df = diff

具体操作请参见自定义Git - Git配置

当你看到这样的命令,git config…

$ git config --global core.whitespace \
    trailing-space,space-before-tab,indent-with-non-tab

... 你可以把它放到你的全局git配置文件中:

[core]
   whitespace = space-before-tab,-indent-with-non-tab,trailing-space

对于一次性配置,你可以使用git config——global user.name 'your_username'

如果你没有全局设置你的git配置,你需要为你在本地使用的每一个git repo这样做。

user.name和user.name。email设置告诉git你是谁,所以后续git提交命令不会报错,***请告诉我你是谁。

很多时候,git建议您运行的命令并不是您应该运行的命令。这一次,建议的命令还不错:

$ git commit -m 'first commit'

*** Please tell me who you are.

Run

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

提示:在我非常熟悉git之前,在运行建议的git命令和探索我认为可行的东西之前,对我的项目文件进行备份,在很多情况下挽救了我的生命。