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?
For each new GForge project that is created at https://gforge.nbic.nl/, a new subversion repository is created automatically. The URL of this repositories is can be found in the GForge web interface.
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!)
GForge & Eclipse
- Using the GForge subversion repository directly from Eclipse
- Source: the The Subversion Handbook