How do I use Subversion?
What is Subversion?
Subversion is a version control system, which allows you to keep old versions of files and directories (usually source code) and keep a log of who, when, and why changes occurred, etc. It is similar to CVS or RCS.
See this primer for Subversion for more information.
What if I want to use CVS instead?
Unfortunately, we don't have detailed instructions for using CVS. You may be able to make the CVS repository available via WebDAV using htpasswd and htaccess files. See the Answers article on WebDAV.
Note: Mercurial is available on Eniac as the command hg . Be sure to look at the Mercurial FAQ for details about the correct SSH path.
Creating a Subversion Repository
This is the syntax for creating your repository (replace "reponame" with the name of your repository):
svnadmin create --pre-1.4-compatible reponame
Important Note: You must use the pre-1.4-compatible flag for the repository to work properly.
Subversion repositories can be created on any SEAS filesystem, and can be accessed via NFS, SSH, or HTTPS. See the Subversion faq for details on how to create and/or use subversion repositories.
There are two options for setting up access to Subversion. It is not possible to use both methods since they use different ways of handling permissions and file locking.
- Subversion over NFS or SSH - use this unless you plan to share the repository with people who do not have SEAS accounts.
- Subversion over https - use this only if you plan to share the repository with people who do not have SEAS accounts.
- Send mail to CETS asking us to create a unix group. The request should include the name of the group (it can be the same as the name of the repository, but it cannot be the same as anyone's PennKey username). The request should also include the PennKey usernames of the people who you want to be included in the group. If you will not be sharing the repository with any other people, then you do not need to request a group. Just use your PennKey username as the group name. Note: there is a 16 group limit for any given SEAS account.
- Make the directory for the repository and run these commands:
chgrp groupname repodir
chmod g+rwxs repodir
- Create the repo using svnadmin.
- You will probably want to add the group sticky bit (chmod g+s) so that all files are automatically created with the correct group settings.
You can then access the repo on any machine that mounts that directory. To access the repository from a machine that does not mount the directory use the subversion URL:
For example, from the unix command line:
svn co svn+ssh://firstname.lastname@example.org/path/to/repository
If you will be sharing files with people who do not have SEAS accounts, please email the following information to cets@seas:
- The repository name and location of repository on disk. Repositories in user home directories must live under $HOME/svn_root, otherwise they must be under /project space.
- Whether people without subversion accounts should have read only access ("world readable") or not ("restricted").
- Whether you plan on using subversion hook scripts.
- The path to the repository htpasswd file on disk. To create an .htpasswd file, follow these steps:
- Connect to Eniac via the command line (we recommend SecureCRT). Navigate to the directory where you want to store your .htpasswd file (we recommend in the $REPO/conf directory).
- Use the following command to create a new .htpasswd file and set up the user "cliff" (change to whatever username you want):
- You will be prompted to enter a password for the user.
- To add other users, use this syntax (where "eric" is another username you want to use):
htpasswd .htpasswd eric
- Make sure your .htpasswd file is world readable (more info on changing permissions).
htpasswd -c .htpasswd cliff
Each repository admin will manage subversion accounts/access via an Apache htpasswd file.
Https repositories will be available via:
and the viewvc view: