简体   繁体   English

Git和Xcode:为什么我必须同意Xcode的T&C才能使用Git?

[英]Git and Xcode: Why do I have to agree to Xcode's T&Cs to use Git?

Git temporarily stopped working after I updated Xcode on my Mac. 在我更新Mac上的Xcode后,Git暂时停止了工作。 The message: 消息:

"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." “同意Xcode / iOS许可证需要管理员权限,请通过sudo以root身份重新运行。”

and then started working once I'd agreed to Xcode's T&Cs and installed the update. 一旦我同意Xcode的T&C并安装了更新,我就开始工作了。

Why, or should I say how, are the two linked? 为什么,或者我应该怎么说,两者是否相关联?

I installed Git using the install. 我使用安装安装了Git。

Your git binary is provided by XCode (which is an easy way to get many command line tools). 您的git二进制文件由XCode提供(这是获取许多命令行工具的简单方法)。

If you don't like this, you can install it manually using Homebrew or similar. 如果您不喜欢这样,可以使用Homebrew或类似方法手动安装。 If you want to compile it yourself you will need a compiler for that. 如果你想自己编译它,你需要一个编译器。 An easy way is using the one provided by XCode (see a pattern here?). 一种简单的方法是使用XCode提供的方法(请参阅此处的模式?)。

I've found that for my needs as a cross-platform Java-using-git developer the binaries provided by XCode are fine. 我发现,作为一个跨平台的Java-using-git开发人员,我需要XCode提供的二进制文件。 This especially since they are automatically updated by Apple over time. 这尤其是因为它们会随着时间的推移自动更新。

In your terminal, run your git command as sudo 在终端中,以sudo身份运行git命令

sudo git status

This will give you the option to view/accept the license agreements. 这将为您提供查看/接受许可协议的选项。 Press enter to view it and press space until you get to the bottom. 按enter键查看它并按空格直到您到达底部。 You can then type "agree" to agree to the license agreements. 然后,您可以键入“同意”以同意许可协议。 This will get rid of that message and you can use git again. 这将消除该消息,您可以再次使用git。

sudo xcodebuild -license will show you the license text of Xcode. sudo xcodebuild -license将显示Xcode的许可文本。

You have to agree its terms and condition at the end or you can just run the command given below. 您必须在最后同意其条款和条件,或者您可以运行下面给出的命令。

sudo xcodebuild -license accept

PS- You are giving access to xcode. PS-您可以访问xcode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM