export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

brew 修改国内源

guofeng@50ed3c1dd5f6 ~ % git -C "$(brew --repo)" remote -v
origin	https://github.com/Homebrew/brew (fetch)
origin	https://github.com/Homebrew/brew (push)
guofeng@50ed3c1dd5f6 ~ % git -C "$(brew --repo homebrew/core)" remote -v
origin	https://github.com/Homebrew/homebrew-core (fetch)
origin	https://github.com/Homebrew/homebrew-core (push)
guofeng@50ed3c1dd5f6 ~ % git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
guofeng@50ed3c1dd5f6 ~ % git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
guofeng@50ed3c1dd5f6 ~ % git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
guofeng@50ed3c1dd5f6 ~ % 


安装 brew 记录

guofeng@50ed3c1dd5f6 ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password).
==> This script will install:

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/sbin/chown -R guofeng:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at bc370748c Merge pull request #10805 from Homebrew/spdx-update
fatal: Could not resolve HEAD to a revision
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:

==> Next steps:
- Add Homebrew to your PATH in /Users/guofeng/.zprofile:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/guofeng/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run `brew help` to get started
- Further documentation: 
guofeng@50ed3c1dd5f6 ~ % echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/guofeng/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
guofeng@50ed3c1dd5f6 ~ % vim /Users/guofeng/.zprofile 
guofeng@50ed3c1dd5f6 ~ % brew help
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

  brew config
  brew doctor
  brew install --verbose --debug FORMULA

  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
guofeng@50ed3c1dd5f6 ~ %