7

When I run git --version in the Terminal, I get prompted to install the "command line developer tools":

Prompt for installing command line developer tools

What exactly do I get from these "command line developer tools", and how much disk space will the installation use up? I don't want to drag along a whole bunch of useless programs just because I want to use a single command.

(Assume that I do not want to use Homebrew, for whatever reason. The question is asking about the disk space used up by an installation of Apple's "command line developer tools").

5
  • 3
    As you now may have deduced from comments I deleted , git, like java, are stub binaries. Apple doesn’t ship git proper with the OS. The stub invokes an installer that will download via a network call a signed copy of the entire framework. Installer is suitable for your CPU type and patched as of when you install it as opposed to when Apple cut the GM seed of macOS. This is how Apple rolls now - same as with legal requirements in Russia where apps install you.
    – bmike
    Apr 3, 2021 at 16:55
  • Given the OPs actual problem should we edit the question to make that clearer - but then again there is a good answer to the headline question
    – mmmmmm
    Apr 4, 2021 at 8:04
  • Is there any reason why you don't want to use homebrew? It would probably be the cleanest alternative. Apr 4, 2021 at 9:14
  • @EricDuminil I was wondering whether or not there are built-in methods to install only Git on MacOS. I don't want to install yet another piece of software (Homebrew) if it can be avoided.
    – Flux
    Apr 4, 2021 at 9:19
  • @Flux: Okay. But since you want to install yet another piece of software (git), you'll have to install something. And it's easy to remove homebrew if you don't need it anymore. Apr 4, 2021 at 9:22

3 Answers 3

9

The installer says it requires 2.72 Gb of space. It installs a variety of Unix tools for compiling software, and other advanced usage (such as git) on the command line, including 'many other useful commands that are usually found in default linux installations' (osxdaily.com). It also includes the SDK frameworks and header files for macOS APIs. And python3.

Separating out what it is exactly that you need and what you don't is not really feasible, and may cause errors. Presumably, you're doing some kind of scripting/programming, for which other tools in the CLDT might be useful.

9
  • 8
    2.72 GB?! What a waste of disk space! I am not doing any kind of programming. I only need Git to place some txt files into version-control.
    – Flux
    Apr 3, 2021 at 12:23
  • 2
    Then as suggested by mmmmmm, install git separately, or use some other version control method.
    – benwiggy
    Apr 3, 2021 at 13:28
  • 1
    @bmike: Still, 2.72GB is completely ridiculous, considering that the underlying system already has many command line tools. Why is it so large? Apr 4, 2021 at 9:19
  • 5
    @EricDuminil It's not just a few command line tools: it's libraries, compilers, and everything needed to build stuff on the CLI. Considering Xcode itself is near 30 Gb, getting it down to under one tenth is pretty impressive.
    – benwiggy
    Apr 4, 2021 at 9:35
  • 4
    @benwiggy: So it's basically the equivalent of build-essentials on Ubuntu. Considering how bloated those "command line dev tools" seem to be, I find it impressive that Xcode can still be 10 times as bloated. Software providers get lazier and lazier simply because storage is getting cheaper. It's not a good trend. Apr 4, 2021 at 9:42
7

As @benwiggy says you cannot split up the command line tools.

However if the issue is just that you want git then there are other ways

  • Install command line git binary and associated tools from the Git downloads web page

  • Install a git GUI tool that includes its own copy of git efor example SourceTree. Other Git GUI clients are listed on the Git website

2

I recently got a Mac, my motivation--coming from Linux--was to find out why Linux projects from developers working on Macs I came across ended up being the maintenance burden for me and my team that they were. Surprising insights.

I have a Unify Dream Machine Pro, so I at least have some insight how much traffic it generated even if an installer for some reason does not want to tell you. I acknowledge that it may be sufficient for Mac users at home to just tell them how long it will take, while game launchers show all kinds of statistics about downloads, but for developers... oh come on Apple!

You won't trust me if I'm not going to post a screenshot, so here it is:

enter image description here

The SSL/TLS connection which downloaded 189 MB was the Visual Studio Code download which instructed me to install the developer tools. So for version 2395 we have 2.84 GB of data.

When I log into the developer portal I can see downloads which are not more than 700 MB in size like Command Line Tools for Xcode 13.4. The numbers don't add up here.

bt@Benjamins-MacBook-Pro ~ % git --version
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

bt@Benjamins-MacBook-Pro ~ % git --version
git version 2.30.1 (Apple Git-130)

bt@Benjamins-MacBook-Pro ~ % xcode-select --print-path
/Library/Developer/CommandLineTools

bt@Benjamins-MacBook-Pro ~ % xcode-select --version   
xcode-select version 2395.

bt@Benjamins-MacBook-Pro ~ %  du -hs /Library/Developer/CommandLineTools/
2.1G    /Library/Developer/CommandLineTools/

The device is an M1 powered MBP late 2021 with macOS 12.4.

Looking further, now "Software Update" from the control panel tells me that there are updates available for Command Line Tools for Xcode 13.2, 13.3 and 13.4. Each around 590 to 740 MB. So you download old software to then download newer software and 3 different releases. This will make sense at some point in my Mac journey, but for the start I only wanted git-cli which should be no more than 50 MB, at least that would be close to what Ubuntu does including direct dependencies.

When I have time I will try to set up a proxy to identify what it downloads, but that has to wait. Trying to use my sonatype nexus repository from the command line as a raw proxy did not work, I guess because it starts a GUI and ignores http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY variables.

3
  • 1
    I ran xcode-select --install and it said 25GB space required, 147 hours to download. Outrageous absurdity. I don't know what funky business is going on with the default downloader. Eventually I went to dev portal to manually download Command_Line_Tools_for_Xcode_13.4.dmg - 723MB, 2min.
    – hackape
    Jul 18, 2022 at 9:04
  • @hackape do you have a link for this?
    – Shawn
    Nov 21, 2022 at 16:19
  • @Shawn find that link in OP’s post.
    – hackape
    Nov 21, 2022 at 23:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .