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

30,988

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.

Share:
30,988
mariano-daniel
Author by

mariano-daniel

Universität von Kalifornien in Berkeley

Updated on December 14, 2020

Comments

  • mariano-daniel
    mariano-daniel over 3 years

    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.

    Thanks!

    • tay10r
      tay10r over 4 years
      You could install VirtualBox and install what you need on a virtual machine. Then you don't have to worry about "cluttering" the Macbook.
    • mariano-daniel
      mariano-daniel over 4 years
      @tay10r: Thanks! But I'd rather keep my developing tools in my computer in case I don't have internet access. But thanks for the tip!
    • metatoaster
      metatoaster over 4 years
      Searching online for "installing git on mac" brought this result which may be an option.
    • mariano-daniel
      mariano-daniel over 4 years
      @metatoaster: D'oh! Thanks! I honestly looked so hardly for the answer, and it was right in front of me. I'll give this link a try and see if I can avoid the Gigabytes from installing Xcode. Thanks!
    • tay10r
      tay10r over 4 years
      @iPodClassic what's internet access have to do with that? A virtual machine doesn't require internet access.
    • torek
      torek over 4 years
      Command line tools are relatively small (the original Unix ones fit in 64K of RAM and less than ten MB of disk storage). GUIs like Xcode tend to be fat and resource-hogs.
    • AMC
      AMC over 4 years
      @torek The most recent version of the Xcode command line tools is 220 MB.
    • AMC
      AMC over 4 years
      OP, the command line tools can be installed on their own, I don’t understand why the entire Xcode IDE would be required. See, for example: osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x.
  • chepner
    chepner over 4 years
    I want to mention nix as a fourth source, but the macOS support is going through some issues with the release of Catalina at the moment.
  • Indigenuity
    Indigenuity almost 3 years
    Except Homebrew explicitly requires git as a prerequisite for installation. An error message in their installation script: You must install Git before installing Homebrew
  • bk2204
    bk2204 almost 3 years
    Right. If you want to use Homebrew, then you'll need the command line developer tools (or the full XCode), which will provide Git. You can then use Homebrew's version, which is generally more up to date.