Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

xcode

Git temporarily stopped working after I updated Xcode on my Mac. The message:

"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo."

and then started working once I'd agreed to Xcode's T&Cs and installed the update.

Why, or should I say how, are the two linked?

I installed Git using the install.

like image 819
Anthony Avatar asked Sep 22 '14 08:09

Anthony


People also ask

Why is Xcode needed for Git?

Xcode will create your new project along with a new Git repository. All source control systems, including Git, store their data into a repository so that they can manage your project versions and keep track of changes throughout the development cycle. Think of a repository as a database for versions.

How can I agree Sudo Xcodebuild license?

Enter this command: sudo xcodebuild --license. Enter system password. Go to the end of file: Press space(button) to do that. Type 'Agree' to the license.

What is git Apple?

Git is a version control system that allows developers to track a project and actively contribute without interfering in each other's work. It supports collaboration within a project and helps prevent miscommunication or code clashing between team members.


2 Answers

Your git binary is provided by XCode (which is an easy way to get many command line tools), and Apple wants you to accept their license before using any XCode component

If you don't like this, you can install it manually using Homebrew or similar. 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?).

I've found that for my needs as a cross-platform Java-using-git developer the binaries provided by XCode are fine. This especially since they are automatically updated by Apple over time.

like image 134
Thorbjørn Ravn Andersen Avatar answered Oct 26 '22 12:10

Thorbjørn Ravn Andersen


sudo xcodebuild -license will show you the license text of 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

P.S.- You are giving access to xcode.

like image 38
Aman Jain Avatar answered Oct 26 '22 12:10

Aman Jain