SVN 101

Let’s start with the basics. I’m assuming you know what svn is and the purpose for it. If not, use Google. This tutorial is to get you going with it. I’m assuming you have it installed and are working on a mac.


There’s an easier way to structure your project (sorry, I’m learning as I go here…)

Pretty simple, you’re going to create a place to put your repos, populate them, then checkout a working copy:


For those of you who want a simpler step by step version, see below:

Set up your test environment:
mkdir ~/Learning
cd ~/Learning
mkdir rawfiles
touch rawfiles/stuff.txt

First step is to create a local repository (I’m assuming we don’t want to make this first tutorial more complex than it needs to be…usually your repo lives on a remote server where people can get access, but we are going to work with everything locally to keep it easy):

Create a repo:
svnadmin create remote
Import your files:
svn import rawfiles file:///Users/{YOUR_NAME}/Learning/remote/trunk -m "initial import"

Now we assume the “remote” is our repo living on a server somewhere. Time to pull down the project so we can start working with it:

Checkout a working copy:
mkdir local
svn co file:///Users/{NAME}/Learning/remote/trunk local/trunk
Let’s see what we have in there:
ls -la local/trunk

“Trunk” is just the main repository. It’s common in svn to use trunk the same way someone might use “Master” in git. It’s the production version of things. Not required, but it is convention.

At this point you’re ready to begin working with the files. In 102, I’ll show you how to setup your project to ignore certain files and begin modifications and commits. Then we’ll create some branches and start merging!

Leave a Reply

Your email address will not be published. Required fields are marked *