xcode “git配置”的必要设置是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18454962/
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
What are the necessary settings for "git configuration"?
提问by Baha
when I create a project in Xcode 4.3 it keeps on displaying message saying below.I did not get what that means and how to do the necessary settings. Any help will be greatly appreciated. Thanks Baha
当我在 Xcode 4.3 中创建一个项目时,它一直显示下面的消息。我不明白这意味着什么以及如何进行必要的设置。任何帮助将不胜感激。谢谢巴哈
Please tell me who you are
Run
git config --global user.email
"[email protected]"
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)")`
回答by Nick Veys
It's telling you literally, exactly what to do. Open a Terminal session, and run this, replacing '[email protected]' with your email address:
它从字面上告诉你,到底该怎么做。打开一个终端会话,并运行它,用您的电子邮件地址替换“[email protected]”:
git config --global user.email "[email protected]"
This sets your email address for git, it uses this to identify who you are in commits.
这会为 git 设置您的电子邮件地址,它使用它来识别您在提交中的身份。
Then, run this, replacing 'Your Name' with your name:
然后,运行这个,用你的名字替换“你的名字”:
git config --global user.name "Your Name"
This sets your name for git commit messages, it uses this to give a more readable name to commits.
这会为 git commit 消息设置您的名称,它使用它来为提交提供更易读的名称。
If this stuff is not clear to you, you reallyowe it to yourself to learn git: http://try.github.io
如果这东西你不是很清楚,那你真的欠自己学git了:http: //try.github.io
回答by jayesh lathiya
Set Name & Email in Xcode preference, this issue will be resolve
在Xcode首选项中设置名称和电子邮件,此问题将得到解决
Follow these 4 simple steps
遵循这4个简单步骤
- Xcode => Preferences => Source control => Git
- Set ( Author Name ) & ( Author Email ), just for identify that the code committed by this name/email
- close Xcode and re-open project
- now try to commit code, it should be working fine now.
- Xcode => 首选项 => 源代码控制 => Git
- 设置(作者姓名)&(作者邮箱),仅用于识别此姓名/邮箱提交的代码
- 关闭 Xcode 并重新打开项目
- 现在尝试提交代码,它现在应该可以正常工作了。
回答by iagomr
Could be a issue with Xcode. Go to your git directory and set the user locally. See the following help thread at Apple Forum for more info:
可能是 Xcode 的问题。转到您的 git 目录并在本地设置用户。有关更多信息,请参阅 Apple 论坛上的以下帮助主题:
回答by Atlas_Gondal
I had same issue in xCode 8.3.2, when I tried to create git repository on local machine. And I fixed it by setting local repository name and email. If anyone is having same issue; just run these commands in terminal:
当我尝试在本地机器上创建 git 存储库时,我在 xCode 8.3.2 中遇到了同样的问题。我通过设置本地存储库名称和电子邮件来修复它。如果有人遇到同样的问题;只需在终端中运行这些命令:
- cd my/project/directory (Navigate to project directory)
- git config --local user.email "[email protected]"
- git config --local user.name "myname"
- cd my/project/directory(导航到项目目录)
- git config --local user.email "[email protected]"
- git config --local user.name "我的名字"
NOTE:This is for local repository, and "--global" flah can be used for remote repositories.
注意:这是用于本地存储库,“--global”flah 可用于远程存储库。