|
SubversionTutorial
Subversion (SVN) is a version control system.
IntroductionSubversion allows users to keep track of changes made over time to any type of electronic data. Typical uses are versioning source code, web pages or design documents (wikipedia). Getting started with SubversionThis tutorial is intended to get you up and running with the subversion repository we use to host the code for this project. It covers installing svn on your own computer, and then using this to connect to the googlecode repository where our code resides. This tutorial mainly lists the concrete commands you'll use to get connected - it doesn't cover the general concepts of version-control in much depth. If you are new to version-control, you will want to read something more comprehensive as well. A good place to start is the official svn manual, which is very clearly written. The main chapters of interest are chapters two and three. This manual can be found at http://svnbook.red-bean.com/en/1.0/index.html
Note: During the following, you will be using both an internet browser, a command-line prompt, and possibly a file-browser such as nautilus or konqueror. For convenience, if you are using the KDE desktop environment, you can make the terminal stay on top of other windows by right-clicking on the black bar at the top and selecting 'stay on top'. Overall WorkflowTerminologyThe first time you retrieve a code project from a repository it is called a 'checkout'. After this, when you pull in later changes in a project from the repository these are called 'updates'. The process of sending your own changes away to the repository is called 'committing'. Checking out is something you do only occasionally, when you start a project or if you decide to move your working directory elsewhere on your hard-drive. Committing and Updating are what you will do regularly. Once you have 'checked out' a project from the repository, then you will use the following processes:
Normally, you should do the update first and then the editing and committing steps, to make sure that you can see what changes others have made recently before you begin your own work! However I listed them in this order as it may make a little more sense if this is your very first check-out and you are new to version control. Otherwise you may wonder "Why on Earth am I 'updating' a project if I only just checked it out?!" Concrete StepsInstalling SubversionThe following install instructions should work for any Debian-related systems, including Ubuntu, Kubuntu, the Computerbank distro, and of course Debian itself. If you are having any difficulties please contact someone for help!
Checking out our code from the Subversion repository on our Google Project siteMaking a spot on your hard-drive to keep the projectBefore checking code out of the subversion repository at googlecode, you must first create a space on your hard drive to put the files. The files downloaded will be an exact copy of all the data inside the repository. So even if you only need one file it's best to get this folder ready to save wasted time and effort later.
Using svn to get a copy of the project from the repository at googleFirst we need to recall the correct command, username, projectname, and password. Rather than trying to remember all this, we can actually just paste it from the 'source' page at our googlecode project on the web.
Opening and altering a fileThe following is an example of what you would do for the 'editing' process listed in the 'overall workflow' section above.
Committing or uploadingThe following is an example of what you would do for the 'committing' process listed in the 'overall workflow' section above.
Other TasksAdding a log messageWe highly recommend that you give at least a short message each time you commit anything to the repository. This log message should describe briefly what changes you have made and why.
The text after the -m flag can either be a string typed directly after the -m at the prompt, or, if necessary, the name of a file where you have previously prepared a longer message. Adding new files and foldersWe have covered how to change existing files (that is, files which were already in the repository when you first checked it out). However we have not yet covered how to add new files or folders to the repository. Adding a new file
svn add <filename>. This tells svn to schedule this file to be added the next time you commit, but it doesn't actually send anything to the repository yet.
Adding a new directory
Particular problems/errors we have hadNot a working copy?This next one only applies if you are using kdesvn, a kde specific version of svn. We recommend against this, as although it has some nice features, kdesvn doesn't "play well" with the usual command line svn. kdesvn creates it's own hidden files, and svn detects these and tries to version them. Or vice versa. Or both. Anyway, the main point is that it becomes very confusing, so we have moved away from kdesvn and now only use svn. If you get a message saying you do not have a working copy when you check at kdesvn subversion/workingcopy/update to head Make sure you are at the top of the tree ie at /trunk. If all attempts still gives you a notice saying you do not have a working copy. A workaround for this is to simply create a new folder somewhere on your computer. Open kdesvn in this folder and check out the repository again. Then use this new folder for svn. |
Sign in to add a comment