Subversion Well, we use subversion at work, and I have a basic idea of how things work such as commiting and changing to older revisions and stuff, but I wanted to learn more. I’ve also used CVS before on the client side, but have never learned anything on the server side of either of these revision control systems. Today I figured I would get my feet wet here so that I could learn a little more. I decided to try to get an SVN server up and running on my desktop (running ubuntu, just like my laptop) that would store a couple different sets of folders. I wanted to set one SVN repository up for my School documents so I can keep those the same everywhere that I go, and I also wanted to create a repository for my work documents. These were the two basic sets that I started with. The first thing to do is to create a directory where you want your SVN repositories; something like: mkdir /path/to/svn Once this is created, you can use the svnadmin command to generate a new repository. For my School repository I did this: svnadmin create /usr/local/svn/School Once this is set up, it’s time to import something into the repository. This can be done 2 ways (ans probably more, but 2 ways that i’ll discuss here). One way is just to checkout the SVN repository and then add files and commit them. This requires setting up the svn server first, however, but I’ll get to that in a minute. The way I imported the first group of files into my School directory was to do this: svn import /home/throughnothing/School /usr/local/svn/School This will be followed by a scrolling list of all the files as the get added to the svn database. Once this is done, the only thing left to do is set up the server, and open that port on your firewall if necessary. The standard subversion port is 3690, but you can use anything you’d like. To run the server, try something like this: svnserve -d -r /usr/local/svn –listen-port=3690 Thats about it! Now try checking out your repository locally first by issuing the following command: svn co svn://localhost/School It works! If you’ve got this working, next make sure your firewall is allowing the port you decided to use through to your machine, and you should be set. I wrote this init script for my computer, should work in any distribution, really simple, maybe not the best way to do things, but it works: #!/bin/sh SVNDIR=”/usr/local/svn/home” COMMAND=”$1? shift case “$COMMAND” in start) echo “Starting SVN server” svnserve -d -r $SVNDIR –listen-port=3690 ;; stop) echo “Stopping SVN server” killall svnserve ;; esac exit 0 Once all of this was working, I decided to try out the tortoise SVN client for windows. Occaisonally for work I have to use windows on my laptop (yes I dualboot the laptop, I need windows for school too sometimes). I decided to try this so I could keep my documents in sync on both operating systems on all machines, etc. I was very impressed by this client. It is very easy to use, and gives you menus in your explorer windows to manipulate almost anything you could need with svn. It lets you check out new repositories, view logs for files or for the whole repository, it lets you lock repositores and much more. Very nice work. Now I can keep my documents in sync across platforms, across computers, and access up-to-date versions from anywhere I may need. If you haven’t messed around with svn or cvs, you should try it out, very cool for anyone who works on multiple computers while trying to keep documents up to date between them.