Subversion server up

If you want access, let me know, I'll create you an account and let you access all the code on all of my websites! There's lots of neat stuff up there.

Subversion is a code versioning system that is heavily used by developers on teams who want to keep their source code in a single place, let people edit or view it, and keep versions of it. Branches are often made when projects are going to be upgraded from, for example, 1.0 to 2.0. The 1.0 branch is kept so that any bugs that come up for 1.0 users can be fixed without them having to upgrade to 2.0. Patching is also very easy with a good versioning system. There are many reasons to use them, and hardly any not to.

But why am I using one? Frankly because I had to set up a Subversion server at work (svn for short), so I knew somewhat how to do it. Also, because it's a good backup system. Like, hmm, this code used to work, I wonder what I did. Then I can just look back at the history of a file and see what changed, and revert back to what worked. Also, for backup, if I ever want to work on it anywhere, I can, because it's on my server that's on the internet 24/7 with the same IP address. Also if something were to happen to my computer and I haven't backed up recently, I'm screwed.

I've set up SVN about 5 times now, so I'm pretty much an expert. One thing that I am not an expert at is the authz file. The other stuff is simple though. Here's a rundown:

yum install subversion (or apt-get install subversion or emerge subversion) (or download it and run the exe or dmg on Windows or Mac)

svnadmin create /var/data/svndata

edit the configuration
vi /var/data/svndata/conf/svnserve.conf

edit the passwd file (add your user)
echo "jason = jason123" > /var/data/svndata/conf/passwd

(I actually haven't tested that exact syntax... it may put it on the same line as a commented line, which wouldn't work)

svnserve -d -r /var/data/svndata

This will create the repository and start the server daemon.

Then you can test it out.

svn mkdir svn://localhost/dev

It might ask you for a username and password then hopefully spit out the message

Committed Revision 1.

Then you can use your favorite code editor plugin for svn and start sharing! Simple as that.

blog comments powered by Disqus