1.mac安装svn
在终端输入下面命令
brew install subversion
结果安装不成功,报错如下:
==> Installing dependencies for subversion: apr, ca-certificates, openssl@1.1, apr-util, gettext, lz4 and utf8proc ==> Installing subversion dependency: apr fatal: not in a git directory Error: Command failed with exit 128: git
重新执行命令
unset HOMEBREW_BOTTLE_DOMAIN
再次执行安装命令,还是报同样的错误~~😂
2.解决办法
查看brew版本
brew -v
如下图,根据提示信息,需要设置safe.directory路径
Homebrew 3.6.11-43-g759ab2d fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-core' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core Homebrew/homebrew-core (no Git repository) fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-cask' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask Homebrew/homebrew-cask (no Git repository)
解决办法,执行下面命令
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
再次执行安装命令,成功安装~
brew install svn//安装svn svn --version//查看版本