错误如下:
error: could not lock config file /usr/local/Homebrew/.git/config: Permission denied
fatal: could not set 'core.repositoryformatversion' to '0'
Failed during: git init -q
报错原因:权限不足
想到用sudo,
貌似不可以,所以,可以给文件夹增加权限,注意这里usr不要写成user
sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local
https://brew.sh/index_zh-cn
再进行安装HomeBrew就可以了
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
检查是否安装成功
brew -v
Homebrew 2.0.6