Skip to main content
add git branch example
Source Link
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. For example, using a separate git branch

git checkout -b my-custom-changes              # new branch
git commit -am "bypass Xcode CLT detection"    # commit changes

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.

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. For example, using a separate git branch

git checkout -b my-custom-changes              # new branch
git commit -am "bypass Xcode CLT detection"    # commit changes
edited body
Source Link
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.shinstall.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/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.

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.

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.

Source Link
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.