Mac 命令行工具 11.4 不再有 svn

Mac command line tools 11.4 no longer has svn

我刚刚将 XCode 和命令行工具更新到 11.4。现在当我 运行 svn 它说 "svn: error: The subversion command line tools are no longer provided by Xcode"。发行说明说 "Command line tool support for Subversion — including svn, git-svn, and related commands is no longer provided by Xcode. If you need Subversion or related command line tools the you need to install the Command Line Tools package by running xcode-select --install." 我似乎陷入了循环,因为工具已安装。有没有人遇到过这个问题并解决了?

brew install svn 

在Xcode 11.4。 Svn 已被删除。

我在 Netbeans 遇到了同样的问题,并从命令行完成了以下操作,现在一切正常

sudo xcode-select --install

macOS 卡特琳娜

升级到 Catalina 10.15 后我遇到了同样的问题。 Apple 网站上明确提到 SVN 在 Xcode 11:

中被弃用

您可以在这里找到它:https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes

Command line tool support for Subversion — including svn, git-svn, and related commands — is no longer provided by Xcode.

解决方案是改为安装独立的命令行工具包:

sudo rm -rf /Library/Developer/CommandLineTools

其次是:

sudo xcode-select --install

这会将捆绑的命令行工具替换为独立包。

如果它对您不起作用,请尝试使用 brew 进行安装。

brew install svn

brew 是 MacOS 的包管理器,所以如果你没有安装它,那么你可以简单地安装它:https://brew.sh/

macOS 大苏尔

今天(2​​020 年 11 月 16 日)升级到 MacOS Big Sur 后,我遇到了同样的问题。我能够通过使用 brew install svn 命令再次安装 SVN 来修复它。

如果您在执行上述命令 运行 后遇到权限错误,您可以通过 运行 以下命令修复它。

sudo chown -R $(whoami) /usr/local/*
  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  2. brew 安装 svn

基于 FreeBSD 背景,我们选择通过类似于 FreeBSD Ports 的 MacPorts 安装 SVN。所以基本上首先需要安装 MacPorts,然后安装 SVN,如下所示:

sudo port install subversion

一些细节-

  1. 安装 MacPorts:https://www.macports.org/install.php

  2. 安装SVN:https://trac.macports.org/wiki/howto/Subversion

它花了不到五 (5) 分钟,对我们来说效果很好。

我的macos版本是macOsCatalina 10.15.5,我试试

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
brew install svn 

但它不是 work.so 我尝试使用源 code.It 的作品安装!

tar xvf subversion-1.14.0.tar.gz
cd subversion-1.14.0
./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util
make

现在,您可以在/usr/local/bin/

中找到它

我切换到 SVNKIT,它非常适合我的目的。因为我做了很多 Java 开发,所以 SVNKIT 基于 Java 对我来说没有缺点。 最大的优势是,即使 Apple 完全抛弃 SVN,SVNKIT 仍然可以工作。

部分基于此处的其他答案,我使用以下过程从源代码构建:

  1. https://subversion.apache.org/download.cgi
  2. cd subversion-1.14.0
  3. ./get-deps(这个好像下载了apr和apr-util但是没有 建造了它们)
  4. cd apr
  5. sudo mkdir /usr/local/opt (因为我已经没有这样的目录了Mac)
  6. ./configure --prefix=/usr/local/opt/apr
  7. make
  8. make test (看到很多“OK”和“SUCCESS”,加上“testsock”中的一个失败)
  9. sudo make install
  10. cd ../apr-util
  11. ./configure --prefix=/usr/local/opt/apr-util --with-apr=/usr/local/opt/apr
  12. cd ..
  13. make
  14. ./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util --with-lz4=internal --with-utf8proc=internal
  15. make
  16. sudo make install

我发现 svn 在 Mac(从 10.15.x -> Big Sur 升级,包括 XCode 升级)在

上仍然可用
/Library/Developer/CommandLineTools/usr/bin/svn

Apple Developers forum 中,我阅读了创建别名的建议,这对我有用。但是,考虑到 svn 正在被 Apple 删除,这可能不适用于新安装,但对于我们这些只想在升级后立即使用它的人来说可能会有用。

alias svn=/Library/Developer/CommandLineTools/usr/bin/svn

注意:我发现将符号 link 制作成 svn 更容易:

ln -s /Library/Developer/CommandLineTools/usr/bin/svn /usr/local/bin/svn