【问题标题】:Xcode 7 Git Setup Fail: unable to auto-detect email addressXcode 7 Git 设置失败:无法自动检测电子邮件地址
【发布时间】:2015-09-24 06:56:27
【问题描述】:

在 Xcode 7 上为新项目启用 Git 存储库源代码控制时,会显示:

但是,即使我在终端中设置了 user.name 和 user.email:

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

我使用终端检查并查看

 git config --global -l

结果显示:

我还使用以下方法检查了项目文件夹中的本地配置:

 git config --local -l

user.name 和 user.email 未在本地设置。

但我仍然无法提交并且来自 Xcode 的相同消息弹出。 任何想法出了什么问题?请帮忙!

【问题讨论】:

  • 在 GIT 的配置文件中。在本地和全局中使用您的姓名和电子邮件更改 user.name 和 user.email 值。然后尝试提交并推送。

标签: ios xcode git version-control git-config


【解决方案1】:

找到解决办法:

  1. 进入项目文件夹,查找./git目录
  2. 使用 TextEditor 打开文件“config”。
  3. 终端 git config 命令似乎未正确应用于此配置文件。它是这样的:
  4. 我把它改成了 并保存。
  5. 提交,一切正常!

旁注:关于如何在项目目录中找到隐藏的 .git。 Xcode 5 - remove source control for project Show hidden file in Mac

【讨论】:

    【解决方案2】:

    在终端中

    $ git config --global user.name "Your Name"
    $ git config --global user.name
    Your Name
    
    $ git config --global user.email "Your email ID"
    $ git config --global user.email
    Your email ID
    

    在本地(针对特定存储库) 在终端进入工作目录

    $ git config user.name "Your Name"
    $ git config user.name
    Your Name
    
    $ git config user.email "Your Email ID"
    $ git config user.email
    Your Email ID
    

    【讨论】:

      猜你喜欢
      • 2014-10-29
      • 1970-01-01
      • 2015-12-06
      • 2021-06-08
      • 2012-04-17
      • 2021-06-30
      • 1970-01-01
      • 1970-01-01
      • 2013-02-28
      相关资源
      最近更新 更多