Hi guys, in today's article we will see how to upgrade Subversion on Mac OS X using Homebrew. Subversion i.e SVN as you know is a popular centralised version controlling system.
First of all check in Terminal, the default pre-loaded version of Subversion that comes packaged with OS X.
svn --version
svn, version 1.7.20 (r1667490)
Now lets install Homebrew on the machine. For that just type the below command as mentioned on
Homebrew's homepage. Btw for those who may be unaware, Homebrew is a free open source package management solution.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now it will begin the installation process and will change/update the owner and permissions of the following folders.
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to ironcladzone:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
Once Homebrew is installed, we need to install Subversion using it. First of all lets get some information about svn installation. Type this in terminal :
brew info subversion
subversion: stable 1.9.3 (bottled)
Version control system designed to be a better CVS
https://subversion.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/subversion.rb
==> Dependencies
Build: pkg-config ✘, scons ✘
Required: sqlite ✘, openssl ✘
Optional: gpg-agent ✘
==> Options
--universal
Build a universal binary
--with-gpg-agent
Build with support for GPG Agent
--with-java
Build Java bindings
--with-perl
Build Perl bindings
--with-python
Build with python support
--with-ruby
Build Ruby bindings
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
You see there are some dependencies that Brew will install along with Svn. Dependencies like sqlite, openssl etc. Proceed with the installation now and be patient for a while till it finishes.
brew install subversion
==> Installing dependencies for subversion: readline, sqlite, openssl
==> Installing subversion dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-6.3.8.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.3.8.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
.
.
.
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/subversion/1.9.3: 148 files, 11.1M
Just check which svn versions are installed on your machine. I mean the locations of svn.
which -a svn
/usr/local/bin/svn
/usr/bin/svn
Now after the installation is complete, if you check svn --version you will still see the older version of svn. Hey but it should be 1.9.3 the latest version right?
svn --version
svn, version 1.7.20 (r1667490)
To fix this we need to add a line to ~/.bash_profile
sudo vi ~/.bash_profile
export PATH="/usr/local/bin:$PATH"
Now type : source ~/.bash_profile
Check the svn version now and it will show the latest one.
svn --version
svn, version 1.9.3 (r1718519)
Cheers! You just upgraded Subversion on Mac OS X. Hope it helps guys!