網頁

2021/1/30

Mac install SVN by Homebrew

在Mac使用Homebrew安裝SVN命令工具的方式如下。

用Mac套件管理工具Homebrew安裝SVN。

在終端機(terminal)輸入brew info subversion檢視subversion(SVN)資訊。

$ brew info subversion
subversion: stable 1.14.0 (bottled), HEAD
Version control system designed to be a better CVS
https://subversion.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/subversion.rb
License: Apache-2.0
==> Dependencies
Build: openjdk ✔, pkg-config ✘, python@3.9 ✘, scons ✘, swig ✘
Required: apr ✘, apr-util ✘, gettext ✘, lz4 ✘, openssl@1.1 ✘, perl ✘, sqlite ✘, utf8proc ✘
...

輸入brew install subversion開始安裝SVN。

$ brew install subversion
...
==> Installing dependencies for subversion: apr, openssl@1.1, apr-util, gettext, lz4, readline, sqlite and utf8proc
...
==> subversion
svntools have been installed to:
  /usr/local/opt/subversion/libexec

The perl bindings are located in various subdirectories of:
  /usr/local/opt/subversion/lib/perl5

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

安裝時會更新Homebrew並下載安裝subversion的依賴套件,要稍微等一下。

安裝結束後輸入svn --version檢視SVN版本資訊,如有出現版本資訊如下代表subversion正確安裝。

$ svn --version
svn, version 1.14.0 (r1876290)
   compiled Jan  6 2021, 17:12:46 on x86_64-apple-darwin19.6.0
...

測試用svn checkout命令下載功能。在終端機輸入
svn checkout http://svn.apache.org/repos/asf/maven/archetypes/trunk/maven-archetype-quickstart maven-archetype-quickstart
下載Java專案套件管理工具的Maven模板 Maven Quickstart Archetype

$ svn checkout http://svn.apache.org/repos/asf/maven/archetypes/trunk/maven-archetype-quickstart maven-archetype-quickstart
A    maven-archetype-quickstart/src
...
A    maven-archetype-quickstart/pom.xml
 U   maven-archetype-quickstart
Checked out revision 1886058.


沒有留言:

張貼留言