Why can't I run git commands after updating to OSX 10.10? - xcode

I upgraded from OSX 10.9 to 10.10. When I try to
git status
I get
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Why do I have to accept a new TOS to run git? Is there a workaround to accepting new Xcode TOS?
I know that I could simply open up Xcode and accept the new user agreement and carry on. I plan on using Xcode in the future and have no specific objections to using it. Wondering how a developer could, hypothetically, choose to continue running git should they disagree with Xcode's new TOS.

If you find that which git returns /Library/Developer/CommandLineTools/usr/bin then you are dependent on xcode functionality and its associated TOS.
If you install through another mechanism, brew or via GitHub command line tools, you would not receive this prompt. You may want to make sure your other version is earlier in your path:
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Related

Git requires commandline dev tools - new xcode update

Xcode had a recent update leading to git commands not working. Message showed up saying commandline dev tools was needed
Edit Fixed:
First I was being prompted to reinstall commandLine tools over and over when trying to accept the terms
I FIXED this by opening xcode and confirming the new update information
NOTE:
I moved this here as another thread had a mix of other issues with the error it was in
First I was being prompted to reinstall commandLine tools over and over when trying to accept the terms
I FIXED this by opening xcode and confirming the new update information

How do you upgrade your git installation using the windows command prompt?

I recently installed railsinstaller on my computer, but have noticed that the installation for git that came with the application is old. I wanted to install it through the git installer, but it never showed me where I would like for the location of git to be at. My other solution is to upgrade it through the command prompt without using the git installer. How do I do this? Which commands would I have to use in the command prompt terminal?
Installing software from the command prompt isn't an easy task on Windows. First, you will need to find out what technology was used to create the installation package. Then you need to download a (UI based) tool which can modify the installation package to stop asking questions and just do what you want. It's certainly possible ... if you can spend a couple of hours or days to find out how.
Now the reason why the git installer isn't asking is probably because it detects an existing install and wants to upgrade it - since the "new" place must be the old place, no question is asked. To "fix" this, you can try to deinstall Git (Control Panel -> Installed Software -> Remove). When you run the installer again, it should give you more options.
If you just want to update the command line tools, you can also try to unpack the installer or install on a second computer. That should give you the git.exe plus all the DLLs and scripts which you can then copy manually. But Git on Windows also install a MINGW environment with a shell and to update that, you probably have to run the installer so it can make the necessary changes to the registry.

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. 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.
Your git binary is provided by XCode (which is an easy way to get many command line tools packaged and maintained by Apple), 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.
In your terminal, run your git command as sudo
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. You can then type "agree" to agree to the license agreements. This will get rid of that message and you can use git again.
tl;dr try opening xcode and installing the plugins it suggests.
Even after I installed xcode, accepted the terms, and followed the developer tools prompt, it would continue to prompt me to install developer tools as if I didn't just do it. I eventually found a thread on reddit that suggested opening xcode and going through the recommended plugin installtion that comes up and that worked for me.

Mac installing libraries using the terminal

I have researched this and found answers on SO on this topic yet remain confused.
Trying to get started with Git. I'm new to shell scripting too so hopefully after this I'll be more familiar with it.
I'm reading this page about how to get up and running with Git: http://git-scm.com/book/en/Getting-Started-Installing-Git
I created a directory on my desktop called "git" and navigated to it in the terminal. With my level of experience in shell scripting this was a victory. Then, following a blog post on how to download fromt he terminal ran this command:
curl -O http://git-scm.com/download
That worked, or at least a new file was added to the "git" directory that I created.
Reading down the instructions one is told that "To install Git, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv"
OK. Um. How? I did read some blog posts and SO answers on how to do this but failed. The first one for example - type zlib and hit enter - command not found? How do I either check if it's already installed or how do I install it? What about the others?
I tried following this blog post: http://www.neuraladvance.com/using-open-source-libraries-on-mac-os-x.html
I typed:
./configure
make
sudo make install
Wasn't even sure what to expect. The first two commands said not found the last one asked me for a password.
I then tried ./configure --help
Was then told "No such file or directory"
Needless to say I don't know what to do next. How do I install the libraries on a Mac using the terminal? curl, zlib, openssl, expat, and libiconv
I'm pretty sure all those libraries are preinstalled on your Mac.
If not, installing Xcode (free on the AppStore) would do the trick.
Xcode actually comes with git (but not the latest version) so if you install Xcode you don't need to install git separately.
To answer your question more generally, you might want to install Homebrew.
It's a command line tool to install software and libraries and it's pretty easy to use.
It's great that you are discovering the shell. You should read some tutorials for beginners. If you like it, you will learn very fast and in a few weeks, you will understand exactly why the command you tried didn't work. Have fun learning!
As Simon suggested you should install Xcode, however the CLI tools are not installed automatically. They must be downloaded through Xcode's, preferences. In Preferences click the Downloads tab then install next to Command Line Tools.
If any of the required tools are not automatically installed with Xcode, Homebrew is a great, easy to use, utility that can install nearly any UNIX or Linux command with the following syntax:
brew install <SomeAppName>
The Homebrew website has easy to follow instructions for setting it up initially. So if anything you need is missing try using that.
In Xcode 5, to download Command Line Tools, choose Open Developer Tool under "Xcode", then More Developer Tools> from the sub Menu. This takes you to an Apple web page - you'll need a Developer username/password to get to the Downloads page.
Choose the right CLT for your system, download and install from the dmg/pkg.

How to install native assembler for Mac OSX?

I am interested to know how can I install native assemblar (I think also known as AS) on Mac OSX Lion. Someone suggested that I can use the Xcode to do it but I didn't see any options.Terminal windows is not able to recognize AS as command right now. Can someone provide more insight on this ? I am new to Mac/Unix environment so please provide help accordingly.
If you have Xcode installed, then you have as.There is no option to install specific packages from the Xcode installer.
as should be in /usr/bin/:
ls -l /usr/bin/as
If not, you probably have a problem with your Xcode installation.
Otherwise, also check your PATH environment variable, to ensure /usr/bin/ is in the list.
echo $PATH
If you've installed Xcode 4.3, it doesn't install the command line tools anymore. To get them, you have to launch Xcode, go to Xcode > Preferences... > Downloads tab, then click the 'Download' button for 'Command Line Tools'. You'll need to sign in with an Apple Developer ID.
Using Xcode 4.6 with Command Line Utilities installed
export PATH=/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
as will execute along with the other command line utilities.

Resources