Settings

Theme

Why is Git in Xcode on macOS?

2 points by fernandokokocha 2 years ago · 2 comments · 1 min read


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).

To make it even worse: on every system update git becomes unavailable, You have to accept your Xcode license to start using it again.

Is it me or it’s a terrible design? That’s super inconvenient, takes so much extra resource, and it's not even a one-time operation. And again, I couldn’t care less about Xcode, I just want my git.

What are the benefits of having within Xcode? I feel that if there are benefits, end-users aren’t the beneficiaries but Apple devs, which would be sad.

[1] https://forums.developer.apple.com/forums/thread/672087?answerId=659036022#659036022

coldtea 2 years 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 2 years ago

    If 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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection