Tag Archives: svn

Mom versus an Ubuntu Terminal My Life 20 APR 2011

I must admit, I was actually quite proud of my mother the other day, when I asked of her a near impossible thing and we came 95% close to actually achieving it!

It all started after another successful Tuesday of working from home while looking after Jessica. Having achieved a fair amount of code during the day, I happily ran a SVN commit before sleepy time and went to bed.

The next morning as I arrived in the office, it struck me like a thunderbolt that I hadn’t run a SVN add before the commit and seeing as committing via a terminal doesn’t automatically do this, I was now in a situation where some of my newly created files from the day before wouldn’t be available to me here in the office!

Now I knew mom was on Jessica babysitting duty for the day, so I took a chance and grabbed the office phone, putting a call through to our home number. Sure enough, mom picked up and after a little banter, I requested that she head for the home office and get comfy.

There I attempted to navigate her through the process of accessing the Applications -> Accessories -> Terminal menu option, changing directory to the correct working folder which I needed her to be in, running various SVN commands like info and status, as well as returning a list of files and directories within various folders.

Now to someone like me this is pretty trivial, but bear in mind that my dear old mom isn’t exactly a PC power user, never mind the fact that she’s only ever used Windows before – and now I have her running around on a text only command line terminal!


Continue reading

Ubuntu: How to Checkout from a SVN Repository via the Terminal CodeUnit 20 JAN 2011

To create an initial SVN checkout from a SVN repository on your Ubuntu machine via the terminal is a pretty simple affair thanks to the pretty standard svn checkout call.

To checkout, enter:

svn checkout https://svn.server:port/svn/project/trunk /home/projectdir

(Obviously you would swap out all the relevant details to match your SVN structure)

You’ll first be asked to accept the SVN server’s key, then for the SVN authentication details, and that is that. SVN will now pull down the necessary files while you go and make yourself a lovely cup of tea.

Note the specifying of a target folder in our call above though. If you omit this, SVN will create the checkout in the current working directory, but it will create a new folder based on the SVN terminating folder to store it in. In other words, if you are checking out from …/branches/version-1.2.0 and you are currently in /home then SVN will create the checkout in /home/version-1.2.0 – you have been warned.


How to Install Subversion (SVN) in Ubuntu CodeUnit 06 JAN 2011

To install subversion (or SVN if you like keeping things short) is pretty simple to achieve in Ubuntu (as with just about everything else).

First, open up a terminal window and enter:

sudo apt-get install subversion

After entering in your password, the system will automatically grab the necessary packages that will need to be upgraded or downloaded and installed, and after a summary screen requesting your explicit go ahead, go about merrily on its business.

Once complete, you will now have the various svn command line calls available to you. (svn help is a great place to start!)

As for actually setting up the SVN, this post might help! :)

Ubuntu Server: Steps to Create a New SVN Repository and Add Users for it Tips, Tricks and Tutorials 17 DEC 2010

To add SVN repositories and give existing user accounts access to it is not entirely a one step process in Ubuntu. So this is how you do it…

First, browse to the folder in which you want to generate your SVN repository and create the respository folder:

cd /home/svn
mkdir projectname

Next, instruct SVN to generate the necessary file structures required into your repository folder:

sudo svnadmin create projectname

Once this has completed, the next step is to open up the repository to the world by making use of the Apache web server. To do this, we need to assign the necessary folder access permissions:

sudo chown -R www-data:svn projectname
sudo chmod -R g+rws projectname

Next, we need to add the new SVN repository details under Apache’s configuration:

sudo nano /etc/apache2/mods-available/dav_svn.conf

Add to the bottom of the file:

<Location /svn> 
DAV svn 
SVNPath /home/svn/projectname 
AuthType Basic 
AuthName "Projectname SVN Repository" 
AuthUserFile /etc/subversion/passwd 
Require valid-user 
ErrorDocument 404 default 

And finally? Restart the Apache service.

sudo service apache2 restart

Next, you must create /etc/subversion/passwd file. This file contains user authentication details.

If you have just installed SVN, the passwd file will not yet exist and needs to be created using the “-c” switch. Adding any users after that should be done without the “-c” switch to avoid overwriting the passwd file.

To add the first entry, ie.. to add the first user, you can run the following command:

sudo htpasswd -c /etc/subversion/passwd user_name

It prompts you to enter the password. Once you enter the password, the user is added.

To add more users after that, you can run the following command:

sudo htpasswd /etc/subversion/passwd second_user_name

If you are uncertain whether the passwd file exists, running the command below will tell you whether the file already exists:

cat /etc/subversion/passwd

Now, to access the repository you can run the following command:

svn co http://hostname/svn/myproject myproject --username user_name


TortoiseSVN: How To Strip ALL SVN Folders Out of a Project to Move it Around CodeUnit 29 JUL 2010

TortoiseSVN is actually a pretty damn good Windows subversion client that neatly integrates itself within the Window shell.

The tortoiseSVN question for today is how to I get a clean copy of one of my projects under subversion, in other words how do I get a folder with all that extra hidden SVN gunk of .svn folders and files?

Well the answer comes in the form of TortoiseSVN’s rather neat and often forgotten right-click context menu export function.

First, locate the folder you wish to get a clean copy of. Next, right-click on the folder and browse down on the TortoiseSVN context menu until you reach the Export menu function.

Clicking this will launch a dialog asking you to select a folder to export to. Once you’ve done that, the system will begin copying over your working copy folder to the newly specified folder, sans all that extra SVN junk.


Ubuntu Subversion: How to Delete a SVN Repository CodeUnit 27 JUL 2010

Although there is tons of documentation on creating new SVN project repositories for your shiny Ubuntu SVN (subversion) server, there isn’t all that much mention of how you actually remove a project repository should you no longer need it.

Funnily enough, that’s probably because the answer to this question is particularly easy.

Simply delete the desired project folder from your repository root and you are done.