Thursday, November 25, 2010

Creating a SVN Repository

Create the repository

> svnadmin create svnrepo

> gedit svnrepo/conf/svnserve.conf

Enable the following lines:

anon-access = none
auth-access = write
password-db = passwd

> gedit svnrepo/conf/passwd

Edit/add user

Create project directory:

> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/trunk
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/branches
> svn -m "Your comment" mkdir file:///data/svnrepo/sample-project/tags

Import the project:

> svn -m "Your comment" import /path-to-source/sample-project file:///path-to-svnrepo/svnrepo/sample-project/trunk

Prepare work location:

> mkdir sampleProject
> cd sampleProject

Local check out trunk of project (without the folder itself):

> svn co file:///data/svnrepo/sample-project/trunk/ .

Remote check out (using SVN + SSH protocols):

> svn co svn+ssh://user@host/path-to-svnrepo/svnrepo/sample-project/trunk/ .

Create user and group svn:

> useradd svn

Add group svn to your groups.

Change ownership of all files in svnrepo/db to svn:

> chown -r svn:svn *

Add write permissions to all files in svnrepo/db.

No comments: