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 -p /home/svnroot
# svnadmin create /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.

Done.

This entry was posted in Linux, Subversion. Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>