<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Confessions of a Guru &#187; subversion</title>
	<atom:link href="http://www.guru.net.nz/blog/category/subversion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.guru.net.nz/blog</link>
	<description>Random stuff from a Dunedin (NZ) based web developer, beer drinker and dad</description>
	<lastBuildDate>Wed, 14 Dec 2011 09:18:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Changing the location of your working copy with Subversion</title>
		<link>http://www.guru.net.nz/blog/2009/12/changing-the-location-of-your-working-copy-with-subversion.html</link>
		<comments>http://www.guru.net.nz/blog/2009/12/changing-the-location-of-your-working-copy-with-subversion.html#comments</comments>
		<pubDate>Wed, 02 Dec 2009 08:20:31 +0000</pubDate>
		<dc:creator>GuruBob</dc:creator>
				<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.guru.net.nz/blog/?p=301</guid>
		<description><![CDATA[Subversion is a popular version control system that will allow you to keep track of any changes to any files (normally text files or source code). If you&#8217;re a developer and you&#8217;re not using a version control system it&#8217;s kind of like being dragged behind a Jeep instead of driving it, except you don&#8217;t realise [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://subversion.tigris.org/"><img class="alignright size-thumbnail wp-image-304" title="svn" src="http://www.guru.net.nz/blog/wp-content/uploads/2009/12/svn-150x150.png" alt="svn" width="150" height="150" />Subversion</a> is a popular version control system that will allow you to keep track of any changes to any files (normally text files or source code).  If you&#8217;re a developer and you&#8217;re not using a version control system it&#8217;s kind of like being dragged behind a Jeep instead of driving it, except you don&#8217;t realise that&#8217;s what&#8217;s happening.</p>
<p>Anyway, when using Subversion you &#8220;check out&#8221; from the repository your own &#8220;working copy&#8221; of the code.  This is where you then make your changes before either reverting them (throwing them out) or committing them (storing them in the repository as the latest version).</p>
<p>There may be situations where the location of the repository (which is usually specified as a URI) may change, and you would prefer to keep your working directory intact rather than having to check out a fresh copy from the new URI.</p>
<p>This is easy enough to do with the &#8220;switch&#8221; command, like so:</p>
<ol>
<li>Start a shell and change into the working directory that you&#8217;re using, e.g. cd /home/bob/projects/myproject</li>
<li>Issue the svn switch command, with the &#8211;relocate option, followed by the old URI and the new new URI, e.g. svn switch &#8211;relocate http://hostname.com/svn/myproject http://newhostname.com/svn/myproject</li>
</ol>
<p>In my particular case I had checked out a working copy from a subversion repository available on my LAN at my workplace, but then when working remotely I could not update or commit files.  The repository is accessible remotely however via HTTPS.  Even though it&#8217;s the same physical repository, the URI that I access it by had changed so my command was:</p>
<pre>svn switch --relocate http://ace/svn/myproject https://work/svn/myproject</pre>
<p>To find the URI of your current working directory, use the &#8220;svn info&#8221; command and look for the Repository Root:</p>
<pre>bob@bob-laptop:/var/www/myproject$ svn info
Path: .
URL: https://work/svn/myproject
<strong>Repository Root: https://work/svn/myproject</strong>
Repository UUID: a13b7e41-fee6-4c75-a229-83425febcc85
Revision: 498
Node Kind: directory
Schedule: normal
Last Changed Author: bob
Last Changed Rev: 498
Last Changed Date: 2009-11-30 14:01:35 +1300 (Mon, 30 Nov 2009)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.guru.net.nz/blog/2009/12/changing-the-location-of-your-working-copy-with-subversion.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

