" git配置"的必要设置是什么?

时间:2013-08-27 00:03:39

标签: xcode git-config

当我在Xcode 4.3中创建一个项目时,它会继续显示下面的消息。我没有得到这意味着什么以及如何进行必要的设置。 任何帮助将不胜感激。 谢谢 巴哈

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 say the identity only in
this repository.
fatal:unable to auto-detect email address
(got 'Home@s-imac-3.(none)")`

4 个答案:

答案 0 :(得分:8)

它从字面上告诉你,到底该做什么。打开终端会话,然后运行此会话,将“you@example.com”替换为您的电子邮件地址:

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

这为git设置了您的电子邮件地址,它使用它来识别您的提交对象。

然后,运行此命令,用您的名字替换“您的姓名”:

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

这为git commit消息设置了你的名字,它使用它来为提交提供一个更易读的名称。

如果您不清楚这些内容,真的欠您自己学习git:http://try.github.io

答案 1 :(得分:2)

设置姓名&在Xcode首选项中发送电子邮件,此问题将得到解决

遵循以下4个简单步骤

  1. Xcode =>首选项=>来源控制=> GIT中
  2. 设置(作者姓名)& (作者电子邮件),仅用于识别由此名称/电子邮件提交的代码
  3. 关闭Xcode并重新打开项目
  4. 现在尝试提交代码,它现在应该正常工作。
  5. enter image description here

答案 2 :(得分:0)

可能是Xcode的问题。转到您的git目录并在本地设置用户。有关详细信息,请参阅Apple论坛的以下帮助主题:

https://forums.developer.apple.com/thread/18189

答案 3 :(得分:0)

我在xCode 8.3.2中遇到了同样的问题,当时我试图在本地机器上创建git存储库。我通过设置本地存储库名称和电子邮件来修复它。如果有人有同样的问题;只需在终端中运行这些命令:

  • cd my / project / directory(导航到项目目录)
  • git config --local user.email“me@me.com”
  • git config --local user.name“myname”

注意:这适用于本地存储库,“ - global”flah可用于远程存储库。

相关问题