Hosting documentation/Subversion
From Bioinformatics.Org Wiki
Contents |
Anonymous Subversion access
Anonymous Subversion access uses svnserve and does not require SSH.
On your local computer, type the following, making the necessary obvious substitution for the repository and module names:
$ svn checkout svn://bioinformatics.org/svnroot/repository[/module] [directory]
Note that you do not need to specify the destination directory. If you are checking out a repository named "bioworks", for example, you could change to the directory where you want the repository to be placed, and then type the following:
$ svn checkout svn://bioinformatics.org/svnroot/bioworks
Subversion clients
If you are using a Unix-variant, Subversion clients are easy to find or may already be installed on your system. Simply type svn to see if you have one.
For Windows, TortoiseSVN is one of the best clients and highly recommended.
Plus, Bioinformatics.Org has a Web interface for browsing and downloading source code from Subversion.
Developer access
For all developer (read/write) access, you will be using SSH (Secure Shell). The SSH (2.x or better) client must be available on your local computer. Note that you will need to type in your password for each command, unless you use ssh-agent with SSH keys. SecurityFocus has articles on generating SSH keys and setting up ssh-agent.
Creating a repository as a developer
This part requires shell access.
Important: You may choose any place on the server (to which you have access) to create a Subversion repository and import your code. However, if you want to enable anonymous downloads and access via the Web interface, the repository has to be in the directory /svnroot, and you must use the following modifications to repository creation:
- Change your primary group affiliation to "svn" using the newgrp command (explanation).
- Use the "FSFS" filesystem type (explanation).
From your shell account on the Bioinformatics.Org server, type the following:
$ newgrp svn $ svnadmin create --fs-type fsfs /svnroot/repository
where repository is the unix name of your group. If you are creating a new repository named "bioworks", for example, you would type the following:
$ newgrp svn $ svnadmin create --fs-type fsfs /svnroot/bioworks
The next set of Subversion commands can be run from your local computer, and they will have the following form:
$ svn command svn+ssh://username@bioinformatics.org/svnroot/repository
Important: If you want to disable anonymous downloads and access via the Web interface, you must edit /svnroot/repository/conf/svnserve.conf, and add the following line:
anon-access = none
Importing source code into a Subversion repository as a developer
On your local computer, change to the parent directory of the directory whose files (and subdirectories) you want to import.
Type the following, where directory is the directory you want to import, module is the name of the new root-level module for the repository, repository is the unix name of your group, and username is your shell account username on the server:
$ svn import directory/ svn+ssh://username@bioinformatics.org/svnroot/repository[/module] -m 'message about import'
If, for example, your username is "jdoe", and you are importing a new module named "trunk" into the repository named "bioworks", you would type the following:
$ svn import bioworks/ svn+ssh://jdoe@bioinformatics.org/svnroot/bioworks/trunk -m 'Initial import.'
Conventional repositories contain trunk, branches and tags modules at the root level.
Initial checkout and other commands as a developer
On your local computer, change to the directory where you want the module to be placed. (Important: This has to be a different directory from the one you used to import the module, since the module will be downloaded as a new directory with some version control files in it.) Then, type the following, making the necessary obvious substitution for the username, repository and module names:
$ svn checkout svn+ssh://username@bioinformatics.org/svnroot/repository[/module] [directory]
After the initial checkout, you can change into this directory and execute other Subversion commands without using the URL of the server. For example:
$ svn update $ svn add filename $ svn delete filename $ svn commit
See also
External links
- Version Control with Subversion (a free book)
- CVS to SVN Crossover Guide
- Subversion Quick Reference (PostScript)