theMechanism has been using Subversion for just over a month now. The following is a quick guide to installing and working with Apache, Subversion and SvnX on Mac OS X:
Apache, Subversion and SvnX on Mac OS X
Apache is the local web server (used to view and test files in the working copy), Subversion is the version control software and SvnX is a GUI-client for Subversion.
Before we can use Apache, Subversion and SvnX, we need to check:
- Is Apache running?
- Is Subversion installed?
- Is SvnX installed?
To test Apache, fire up the browser of your choice and enter
into the address bar. If you do not see an "Unable to connect," "Can’t connect to server," or "Error! Connection closed by remote server" screen, Apache is running.
If it is not running, open System Preferences. Under "Internet & Network," choose "Sharing." Make sure "Web Sharing" is checked ("Personal Web Sharing" in Tiger).
is pointed at
To see if Subversion is installed, launch Terminal (Applications | Utilities | Terminal). At the prompt, type:
Some information on the version and build should appear. If not, Subversion is not installed.
If Subversion is not installed, download and install the latest version from http://www.collab.net/downloads/community/
To see if SvnX is installed, check for svnX.app in the Applications directory.
If it is not there, download and install the latest version from
Working with Subversion via SvnX
Standard Subversion workflow:
- Check out a working copy
- Make edits to the working copy
- Commit the edits to the repository
Checking out a repository
Launch SvnX and set the focus on the "Repositories" window.
Click the "+" button to add a repository.
- Change the name to something descriptive.
- Enter the path to the repository.
- If required, enter your user name and password for the repository.
Once a repository has been added, it will appear in the top half of SvnX's Repositories window. Double-click on the repository to open it:
Click the "svn checkout" button at the top of the window and navigate to a directory below
. Click the open button and SvnX will download the repository to your local machine.
Close the current window and the SvnX "Repositories" window.
The Working Copy
Set the focus on the SvnX "Working Copies" window. Note that SvnX has added a working copy after check out. Change the name to match the descriptive name in the previous step.
Double-click on the working copy in the top half of the "Working Copies" window. The main thing to be aware of here is the "Update" button. Click this to refresh your local working copy with any changes made to the repository by any other team member.
In Finder, navigate to the working copy, open index.html in your favorite HTML editor, make some small change and save index.html.
Switch back to the active working copy window and click the "Refresh" button at the top of the window. You’ll see that index.html is added with a "M" (modified).
If you're happy with the change and have previewed it to make sure everything is working, press the "Commit" button on the right side of the screen.
Add a meaningful commit message and press commit.
Version control principles
- Update often!
- Keep your working copy up-to-date by updating often.
- Commit early and often!
- Early and often means make atomic changes. Change one thing, test and then commit with comments.
- Never commit broken code!