How do I use Subversion?
Subversion is an
open-source, centralized version control
system, which allows you to archive files (usually source code) and track
the changes made to them. Similar to CVS or RCS, it was created in 2000 to fix
bugs and supply features missing in CVS. It enjoyed brief popularity until more
flexible distributed
version control systems (DVCS) such as git
and Mercurial
(hg
) became available.
See the Version Control with Subversion book for more information.
Creating a Subversion Repository
Run this command in a terminal to create a subversion 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 with the SEAS subversion server.
Subversion repositories can be created on any SEAS filesystem, and can be accessed via NFS, SSH, or HTTPS.
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.
Subversion over NFS or SSH
Penn VPN software is required for all SSH connections from networks that are outside of PennNet.
Before connecting to a machine on PennNet via SSH from an external network, you must install and run the University Client VPN software:
- 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:
svn+ssh://eniac.seas.upenn.edu/full/path/to/repository
For example, from the unix command line:
svn co svn+ssh://username@eniac.seas.upenn.edu/path/to/repository
Subversion over HTTPS
If you would like to use the SEAS subversion server, please email the following information to cets@seas:
- The name of the repository on disk, which must live under
$HOME/svn_root/
, unless it is under the/project/
space. - Do you plan on using subversion hook scripts?
- Access restrictions:
- Publicly viewable
- PennKey authentication required (include path to
.htgroup
file) - User/password file you manage yourself with
htpasswd
(include path to.htpasswd
file)
User/Password File
If you require restricted access for users without PennKeys, you will need
to use htpasswd
to manage usernames and passwords for all of your
users.
- 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):
htpasswd -c .htpasswd cliff
- 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).
Each repository admin will manage subversion accounts/access via an Apache htpasswd file.
HTTPS repositories will be available via:
https://webdav.seas.upenn.edu/svn/reponame
and the viewvc view:
https://webdav.seas.upenn.edu/viewvc/reponame