The "git" command requires the command line developer tools. Would you like to install?

Question:

I’m super new to coding (actually trying to teach myself some Python), but there’s a thing bugging me that I cannot seem to find any info online about my particular case: When I run git on the terminal, there is:

The "git" command requires the command line developer
tools. Would you like to install.."

Now, since I have a very basic Macbook 12, I try to keep it as lightweight and uncluttered as possible, so I don’t want to install any IDE or anything, I’m practising coding with vim 7.3, but in order to install Vundle.vim to manage any plugins, I need git, is there a way I can install it without having to install Homebrew?

Thanks for any input! And sorry if I didn’t express myself correctly. So basically to sum up:

– I need git to install Vundle.vim, (or is there any other way?).

– I run git on terminal and get an error that I need to install Xcode, which is like 7GB heavy.

– I don’t want to install Xcode or Homebrew.

Asked By: mariano-daniel

||

Answers:

There are three main sources for Git on macOS.

The first is Apple, using the command line developer tools. These tools install a standard set of Unix development tools, including a compiler and Git. While this is called the XCode development tools, it is significantly smaller than the full IDE XCode environment.

The second is Homebrew, which is commonly used for this purpose. It’s going to be the most up to date. This also requires the command line developer tools.

The third is the download page from the Git website. This is maintained by a third party, not the Git maintainers, and isn’t always up to date, but it’s usually only a few versions behind.

The last option is to compile from source, but that requires a compiler, which generally requires the command line developer tools.

Barring other package managers like Fink, there are no other reputable sources for Git packages on macOS. You’ll have to pick one of the options above if you want to use Git.

Answered By: bk2204

I encountered the same issue when I was going to use Git on a new macOS. My solution is pretty simple, but just to install homebrew.

The trick is that homebrew install loads a git repo of full source history. To achieve this, it firstly installs XCode command line development tool to get Git.

Then, after you have homebrew, you can benefit from XCode tools to issue git commands. Note that no need to install other parts of XCode here.

I was also surprised to see what happened at homebrew install. There might be a reason from homebrew developers.

Answered By: themefield

I also happened to see this issue. And I tried to install the command line developer tools as the popup reminder. However, after the installed done, I restarted my MAC tens of times, also not work. [Repeated many times]

Finally, I tried to update the software with this cmd sudo softwareupdate -ia --verbose. It took more than half hour to download and another 20 mins to install and restart. The problem was solved to me. Hope this can help you.

Or try with this xcodebuild -runFirstLaunch

Answered By: Jie Yin

For me problem has resolved with:

xcodebuild -runFirstLaunch
Answered By: markych

For me it seemed like

xcodebuild -runFirstLaunch

solved the problem, but instead when I tried to use git, it still complained that it cannot find git and requested the installation of the XCode Developer Command Line Tools again and again.
Until I found this answer here.

Long story short:

sudo xcode-select -switch /Library/Developer/CommandLineTools

saved my day.

Answered By: NiklasLehnfeld
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.