2 ms·
>On a new macOS machine, you are basically tricked into installing git along with Xcode [1]. If you do so, you have to download an 8GB package, even if you only
by coldtea 3y ago
>On a new macOS machine, you are basically tricked into installing git along with Xcode [1]. If you do so, you have to download an 8GB package, even if you only want git (which is my case and I can’t be the only one).
So, just install Brew, or MacPorts, or Nix, and use them to install just git, or just download a git binary directly. You can also download the smaller "Command Line Tools" package that includes git and clang.
The user is not really tricked: the XCode installer is neither meant, nor advertised as the way to get git when you just want git. Xcode installs various libs, tools, and, among them, git, for its own purposes. So, sure, if you want to use XCode you'll also get an installation of git, but the reverse is in no way necessary.
- pxc 3y agoIf you don't have XCode installed and you run `git` you get a stub executable that prompts you to install the XCode command line tools. That's a bit of trickery and an annoyance imo, though it's not a whole install of XCode. Also it takes quite some footwork to actually get by without the XCode Command Line tools on macOS if you use Homebrew. The Homebrew installer installs them, and at some point Homebrew itself added checks to see if it's around, either in brew or in some packages (IDR which) so sometimes it'll install them even if another Git is available. It can also be a bit annoying with Nix, since Nix shells out to Git impurely for flakes operations (it does this to simplify authenticating to Git repos, I think), but that also means that it assumes a working Git implementation is available, and the stub that comes on macOS isn't one, obviously. Not a huge deal (I say just install the CLT), but I definitely consider those stub executables stupid and annoying.