Skip to main content
2 of 3
edited body
anthumchris
  • 309
  • 3
  • 12

Homebrew on a Mac can be installed without Xcode Command Line tools. Technically, Git is the only requirement for the initial Homebrew installation. Then, you can use Homebrew to install all packages required by other packages/formulae.

  1. Install a temporary Git independently (see Binary installer).
  2. Download and save install.sh from https://brew.sh. Make the following change to it:
    # USABLE_GIT=/usr/bin/git      # Xcode CLT Git
    USABLE_GIT=/usr/local/bin/git  # Your temporary Git
    
  3. Install Homebrew /bin/bash -c install.sh
  4. Delete your temporary Git.
  5. Install Git with Homebrew brew install git
  6. Modify local file /usr/local/Homebrew/Library/Homebrew/os/mac/xcode.rb:
    def self.installed?
      true  # Override Homebrew's CLT check
      # odeprecated "`MacOS::CLT.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux?
      # !version.null?
    end
    

Overriding self.installed? ensures that you can install packages that would otherwise require it (i.e. brew install python). You'll need to version this change to prevent it from being overridden during brew update.

anthumchris
  • 309
  • 3
  • 12