SubversionNewRepo

From CT Wiki
Jump to: navigation, search

Setting up a new Subversion repository

Setting up a new Subversion repository is quite easy:

  • log in on the subversion server svn.nikhef.nl (this is restricted to special users)
  • choose or use a common directory where the Subversion repositories for your group are located, e.g. for the Electronics Group the directory
 /project/et/svn

is used.

  • make sure you have write access in this directory
  • now go to this directory and create a new repository:
 $ cd /project/et/svn
 $ svnadmin create <NameOfRepository>

where <NameOfRepository> is the name for your new Subversion repository

  • make sure that the directory is group-writable so that the Subversion generic user account (e.g. etsvn for the Electronics Group) has access:
 $ chmod -R g+w /project/etc/svn/<NameOfRepository>

Setting up a new Git repository

Setting up a new Git repository is similarly easy:

  • log in on the git/subversion server svn.nikhef.nl (this is restricted to special users)
  • choose or use a common directory where the Subversion repositories for your group are located, e.g. for the Electronics Group the directory
 /project/et/git

is used.

  • make sure you have write access in this directory
  • now go to this directory and create a new directory:
 $ cd /project/et/git
 $ mkdir <NameOfRepository.git>

where <NameOfRepository.git> is the name for your new Git repository

  • change to this directory and create a new Git repository
 $ cd /project/et/git/<NameOfRepository.git>
 $ git init --bare
  • make sure that the directory is group-writable so that the Git generic user account (e.g. etgit for the Electronics Group) has access:
 $ chmod -R g+w /project/etc/git/<NameOfRepository.git>


Adding access control

As owner of the repository you can control access to the repository. You can allow or restrict access to different parts of projects within a Subversion repository. The files

 <NameOfRepository>/conf/svnserve.conf
 <NameOfRepository>/conf/authz[.txt]

are used to control access. It is easier (mostly for Windows users) to add an extension to the authz file so that it is easier to edit on Windows. For this, the svnserve.conf file needs a minor modification:

 ### Uncomment the line below to use the default authorization file.
 authz-db = authz.txt

A modified version of this file can be found in

 /project/et/svn/svnserve.conf

The authz.txt file can now be edited using any text editor.

Views
Personal tools