How to setup a basic SVN repository and server

Become root and install subversion via yum

# yum install -y subversion

Create your svnroot directory

# mkdir /home/svnroot

Edit your svnserve.conf

# vim /home/svnroot/conf/svnserve.conf

Your basic svnserve.conf will look like this:

[general]
anon-access = none
password-db = passwd
authz-db = authz
realm = Masao’s First Repository

Edit your authz file

# vim /home/svnroot/conf/authz

to look like this

[/]
masao = rw

Edit your passwd file

# vim /home/svnroot/conf/passwd

to look like this

[users]
masao = mypassword

Start your svn server

/usr/bin/svnserve -d -r /home/svnroot/

Create a directory and some files in it

$ mkdir myproject

$ cd myproject

$ touch myfirstfile mysecondfile

$ svn import . svn://localhost/myproject -m “initial commit”

Adding mysecondfile
Adding myfirstfile
Committed revision 1.

Now checkout your project

$ cd /tmp

$ svn co svn://localhost/myproject
A myproject/mysecondfile
A myproject/myfirstfile
Checked out revision 1.

You’re done!  Thanks Ian!

Leave a Reply

You must be logged in to post a comment.