==> Fetching /usr/local/Homebrew...
error: cannot open .git/FETCH_HEAD: Permission denied
error: Unable to create '/usr/local/Homebrew/.git/refs/remotes/origin/HEAD.lock': Permission denied
error: Could not setup refs/remotes/origin/HEAD
==> Resetting /usr/local/Homebrew...
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
error: cannot open .git/FETCH_HEAD: Permission denied
error: Unable to create '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/refs/remotes/origin/HEAD.lock': Permission denied
error: Could not setup refs/remotes/origin/HEAD
==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
fatal: Unable to create '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/index.lock': Permission denied
解决方式
sudo chown -R $(whoami) $(brew --prefix)/*