Tuesday, November 4, 2008

creating svn repository in Fedora

Lets first install subversion (svn server packages) and Apache module for subversion:

$ yum -y install subversion mod_dav_svn

$cd /etc/httpd/conf.d/
$ vi subversion.conf

# Make sure you uncomment the following if they are commented out
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

# Add the following to allow a basic authentication and point Apache to where the actual
# repository resides.

DAV svn
SVNPath /var/www/svn/repos
AuthType Basic
AuthName "SVN Access"
AuthUserFile /etc/httpd/conf.d/svnpassowrd
Require valid-user

Add user who can access the repository:
$ htpasswd -cm /etc/httpd/conf.d/svnpassowrd user1
(It will ask for the apssword for the user 'user1')

$ htpasswd -m /etc/httpd/conf.d/svnpassowrd user2
(It will ask for the apssword for the user 'user2')

Create the repository:

$ cd /var/www/
$ mkdir svn
$ cd svn
$ svnadmin create repos
$ chown -R apache:apache repos
$ service httpd restart

Access repository from a web browser:
(It will ask the apache authentication user and password, supply the user/pass we created using htpasswd command)

Imporing a project into repository:
$ svn import /home/sanjay/testproj/ file:///var/svn/repos/testptoj -m "initial testproject"

Here "repos" is the svn repository (created by svnadmin create command) and "testproj" is one project inside this repository.
/home/sanjay/testproj is the folder containing all the files we want to be in repos.

Adding a dir tree in the existing repository.
Case: Although we can use the svn add/commit but if the dir is too big and there is no UI access for svn repository then
better use the "import" command of svn.

Now if we want to add "wiki" folder into the "testproj" then use the import as below"

$ svn import /home/sanjay/testproj/wiki/ file:///var/svn/repos/testproj/wiki -m "wiki folder in testproj"

No comments:

Whats new in Ajuby 0.5