尝试使用
在我的 Mac 系统(High Sierra 10.13.3)上更新git
brew install git
给出输出
$ brew install git
==> Downloading https://homebrew.bintray.com/bottles/git-2.16.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.16.2.high_sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man5/gitattributes.5
/usr/local/share/man/man5 is not writable.
You can try again using:
brew link git
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions and functions have been installed to:
/usr/local/share/zsh/site-functions
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> Summary
🍺 /usr/local/Cellar/git/2.16.2: 1,496 files, 34.5MB
但是,你可以看到它在brew link
这一步有问题。尝试通过运行来修复它
brew link git
brew link --overwrite git
brew link --force git
同样的错误
Linking /usr/local/Cellar/git/2.16.2...
Error: Could not symlink share/man/man5/gitattributes.5
/usr/local/share/man/man5 is not writable.
有人也遇到过这个问题并设法解决了吗?
Mac 的用户和组
输出
最佳答案
您必须修复权限:
sudo chown -R "$USER":admin /usr/local
sudo chown -R "$USER":admin /Library/Caches/Homebrew
如果您是系统上唯一的 Homebrew 软件用户,它运行良好。如果第三方工具正在等待 /usr/local
上的其他权限,则可能会导致问题。但是,我使用这个设置多年没有问题。参见 How to fix homebrew permissions?了解详情。
但为此您必须有权管理计算机。在系统偏好设置 -> 用户和组中,您的用户应该选中“允许用户管理这台计算机”复选框。 p>
关于git - Mac : Could not symlink share/man/man5/gitattributes. 5 中的 brew 安装 git 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49014472/