Difference between revisions of "Subversion"
(New page: Users of the Life Science Grid have a subversion repository at their disposal. This document explains what subversion is, and where you can find it. == What is Subversion?<ref name="s...)
Revision as of 19:24, 3 December 2007
Users of the Life Science Grid have a subversion repository at their disposal. This document explains what subversion is, and where you can find it.
What is Subversion?
Subversion is a free/open-source version control system. That is, Subversion manages files and directories over time. A tree of files is placed into a central repository. The repository is much like an ordinary file server, except that it remembers every change ever made to your files and directories. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of “time machine”.
Subversion can access its repository across networks, which allows it to be used by people on different computers. This ability for various people to modify and manage the same set of data from their respective locations fosters collaboration. Progress can occur more quickly without a single conduit through which all modifications must occur. And because the work is versioned, you need not fear that quality is the trade-off for losing that conduit—if some incorrect change is made to the data, just undo that change.
Where can the subversion repositories be found?
Within the Life Science Grid, there's a separate repository for each cluster. The URL of these repositories is:
For example, if you're in group sara, you could type the following on the command line:
[john@mgt-se-ams john]> svn list https://www.els.sara.nl/svn/sara/mediawiki branches/ tags/ vendor/ [john@mgt-se-ams john]> _
As you can see, the command
svn yields the names of all subdirectories in project mediawiki in the repository of group sara.
Common svn commands
- All subversion actions are done with one single program:
- svn has a built-in help function:
svn help [command]
Checkout, update, commit, export
- svn checkout <URL> [path]
- (once) to create (check out) your own working copy. Example:
svn co https://www.els.sara.nl/svn/project1/trunk ./project1
- svn export <URL> [path]
- pretty much like checkout, but the new directory is not a working copy.
- svn update
- to apply the latest changes in the repository to your own, local working copy.
- svn commit
- to apply your local modifications of your working copy to the repository. By default, $SVN_EDITOR (or $EDITOR) is started for you to enter the message. You can also specify the message as an option. Example:
svn commit -m 'fixed bug #4175'
Getting and setting file info
- svn status
- shows the status of (all files inside) the current directory.
- svn log <filename>
- shows the history of a certain file.
- svn diff <filename>
- shows the local modifications of a file, compared to the version of the latest update.
- svn add <filename/dirname>
- brings a file/directory under version control. (remember the file/directory must still be committed!)
- svn delete <filename/dirname>
- stages a file/directory for destruction. (remember the destruction must still be committed!)
- svn move <filename/dirname> <path>
- renames/moves a file/directory. (remember the file/directory must still be committed!)
- svn copy <filename/dirname> <path>
- copies a file/directory. History is maintained. (remember the new file/directory must still be committed!)
- Source: the The Subversion Handbook