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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With