Create a New Repository
-
Create a new subversion repository
svnadmin create --fs-type fsfs /var/svn/repository-name
-
Set permissions on new repository so that svn-group has full access
chgrp -R svn-group /var/svn/repository-name chmod -R g+rw /var/svn/repository-name find /var/svn/repository-name -type d -exec chmod g+s {} \;
-
To initialize the repository, create a project directory somewhere, and in that directory create trunk/, branches/, and tags/ directories. Then, import the project directory into the repository.
svn import /path-to-project-directory/ file:///var/svn/repository-name --message 'Initial Import'
Wrapper Scripts
In order to properly maintain group permissions in a multi-user environment, wrapper scripts must be created for the svn utilities on the server to set the proper umask.
cat << EOF > /usr/local/bin/svn #!/bin/bash umask 002 /usr/bin/svn "\$@" EOF chmod +x /usr/local/bin/svn
cat << EOF > /usr/local/bin/svnadmin #!/bin/bash umask 002 /usr/bin/svnadmin "\$@" EOF chmod +x /usr/local/bin/svnadmin
cat << EOF > /usr/local/bin/svnlook #!/bin/bash umask 002 /usr/bin/svnlook "\$@" EOF chmod +x /usr/local/bin/svnlook
cat << EOF > /usr/local/bin/svnserve #!/bin/bash umask 002 /usr/bin/svnserve "\$@" EOF chmod +x /usr/local/bin/svnserve