Subversion, sometimes called SVN, is an open-source program for managing changes (versions) made to files or folders. It is of great help if you want to keep track of how your documents have changed over time, or if you need to recover an old version of a particular file. Here are the steps to install Subversion on Mac OS X.
Steps
Method 1 of 2: Part One: Binary Package Installation
Step 1. Go to 'https://subversion.apache.org/packages.html# osx'
You will find a considerable number of packages to download, each with different requirements. Choose the one that best suits your needs.
Step 2. Unzip the contents of the '.pkg' file
An installation file will be created directly on your desktop. Select it with a double click of the mouse and follow the instructions that will appear on the screen and will guide you through the installation process.
Step 3. Open a 'Terminal' window
You can do this from the 'Utilities' folder. Alternatively, you can search with 'Spotlight' by typing 'Terminal'. In the terminal window, type the following command starting at the '[username] $' prompt:
-
'svn' (without quotes) and press [enter]
-
If the response to this command is 'Type' svn help 'for usage', then SVN is working correctly.
-
If the system path '/ usr / local / bin' is unreachable, edit your '.profile' file and add the following line of code:
'export PATH = $ PATH: / usr / local / bin' (without quotes)
-
Open another terminal window and type the 'svn' command again by pressing [enter].
Method 2 of 2: Part two: Set up the Subversion Environment
Step 1. Configure the SVN server
This step is necessary to allow users to access all projects managed with Subversion.
Step 2. Launch a 'Terminal' window and create a directory called 'svnroot' (without quotes) in your profile directory using the following command:
'mkdir svnroot' (without quotes).
-
Type: 'svnadmin create / Users / [your username] / svnroot' (without quotes)
-
Done! You have just created your SVN server.
Step 3. Use the SVN server from the terminal window. You can 'checkout' directly from the terminal using the following command: 'svn checkout file: /// Users / [your username] / svnroot' (without quotes).
-
If you want to remotely access your SVN server, enable the 'Remote Login' service by going to 'System Preferences / Sharing'. To 'checkout' a project remotely, use the following command: 'svn checkout svn + ssh: //my.domain.com/Users/ [your username] / svnroot'
Step 4. Configure the Subversion Client
For example the svnX client supports all versions of Mac OS X from 10.5 to 10.8. You can download it at the following link.
Step 5. Once the SVNx download is complete, launch it
You will be faced with two windows, one called 'Working Copies' and the other 'Repositories'. In this last window, you will need to add the URL and login details to your SVN server.
-
Open the window, if you get an error, check your login credentials (LogIn).
-
Return to the terminal window and type the following command: 'svn import -m "your import message" / local path / to / project / repository / on / server / SVN' (without quotes). This command will add all files of your project locally in the repository indicated on the SVN server.
-
In the SVNx 'Working Copy' window, add the path to the repository located on the SVN server.
Step 6. Enter SVNx 'Working Copy' window
It is in this window that you will be able to see the changes when you work on the project.
Step 7. Run control tests
Make small changes to the project from your 'Working Copy' window, then update the window display.
SVNx will show all files that have undergone changes. Press the 'Commit' button to copy the changes to the SVN server repository
Step 8. If you prefer to work on Subversion repositories directly through Finder, consider using SCPlugin or SVN Scripts for Finder.
Advice
- The main documentation for learning about Subversion is the free book 'Version Control with Subversion', also known as 'The Subversion Book'. You can download a copy at this link
- There is also some additional documentation which you can find in the '/ doc' directory of the Subversion source code. See the 'README' file in the 'doc' folder for more information.