<?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>nothing2fancy &#187; remote</title>
	<atom:link href="http://nothing2fancy.com/tag/remote/feed/" rel="self" type="application/rss+xml" />
	<link>http://nothing2fancy.com</link>
	<description>pew-pew</description>
	<lastBuildDate>Sat, 19 Jun 2010 16:27:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remote Version Control with Subversion and Xcode</title>
		<link>http://nothing2fancy.com/2009/04/27/remote-version-control-with-subversion-and-xcode/</link>
		<comments>http://nothing2fancy.com/2009/04/27/remote-version-control-with-subversion-and-xcode/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 03:53:13 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://nothing2fancy.com/?p=315</guid>
		<description><![CDATA[I split my development time between my MacBook and iMac, so I&#8217;ve been using some form of source control for the last few months (previously to that I was copying the files back and forth manually&#8230; ugh).

Up until last month I was using iDisk and Mobile Me to keep things straight. This actually works pretty [...]]]></description>
			<content:encoded><![CDATA[<p>I split my development time between my MacBook and iMac, so I&#8217;ve been using some form of source control for the last few months (previously to that I was copying the files back and forth manually&#8230; ugh).</p>

<p>Up until last month I was using iDisk and <a href="http://www.apple.com/mobileme/">Mobile Me</a> to keep things straight. This actually works pretty well, which is why I kept using it for so long. Turn on iDisk sync and you&#8217;re given a new web-based drive on your desktop. Store your projects in there and they&#8217;ll always be up-to-date, no matter where they&#8217;re stored.</p>

<p>I had a few problems with this setup, thought.</p>

<ol>
<li>iDisk doesn&#8217;t handle <a href="http://en.wikipedia.org/wiki/Symbolic_link">symlinks</a> well. This didn&#8217;t make any difference to my project, but some of the sample code I&#8217;d download wouldn&#8217;t work when it was running from the mounted iDisk volume.</li>
<li>References to bundle resources are flakey. I never did figure out what caused this. Loading images from files worked fine, but trying to load sample data from an .XML file was completely broken, unless I stored the file somewhere besides the mounted iDisk volume. Since the file was small and never changed I got around this limitation by storing it on the Desktop on every computer I used, but it was still a janky solution.</li>
<li><a href="http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeSourceManagement/20-Technology_Overview/overview.html#//apple_ref/doc/uid/TP40002685-SW3">Xcode snapshots</a> are broken. First, snapshots didn&#8217;t move from computer to computer, so if I made a snapshot on my laptop, it wouldn&#8217;t show up on my desktop. Second, the snapshots didn&#8217;t seem to persist when the project was stored on the iDisk volume.</li>
</ol>

<p>I probably could have overcome all these issues with some effort, but why not save myself the headache and do proper SCM with <a href="http://subversion.tigris.org/">subversion</a>? Since it already has built-in <a href="http://developer.apple.com/tools/subversionxcode.html">Xcode support</a>, I figured it&#8217;d be a breeze to set up. And for the most part it was.</p>

<p>The <a href="http://iphonedevelopment.blogspot.com/2009/03/version-control-is-your-friend.html">instructions</a> I followed were from <a href="http://twitter.com/jeff_lamarche">Jeff LaMarche</a> and his excellent <a href="http://iphonedevelopment.blogspot.com/">iPhone Development blog</a>.</p>

<p>The helped me set up the repository, but didn&#8217;t go quite far enough. Since I&#8217;m working from two machines at the same time<sup><a href="#84293" id="fn1" title="see footnote 1">1</a></sup>, I need to be able to access my code from whichever machine I&#8217;m on. Most tutorials out there seem focused on either setting up local repositories, or setting up shared repositories on OS X Server, neither of which quite give me what I need.</p>

<h3>Creating the Shared Repository</h3>

<p>Since subversion is installed in OS X by default, setting up the repository is simple. These instructions are ripped from from Jeff&#8217;s blog. Open up Terminal and run the following commands.</p>

<p><pre>cd /Users/Shared
mkdir subversion
cd subversion
mkdir HelloWorld
svnadmin create HelloWorld
chmod -R 777 HelloWorld</pre></p>

<h3>Setting up Remote Login in OS X</h3>

<p>In order to securely access your repository remotely, you&#8217;ll need to turn on remote login in OS X. Navigate to the <strong>Sharing</strong> tab in <strong>Preferences</strong> and turn <strong>Remote Login</strong> on.</p>

<p><a href="http://nothing2fancy.com/images/url_images/Sharing-20090423-074437.png"><img src="http://nothing2fancy.com/images/url_images/Sharing-20090423-074437.png" width=400 /></a></p>

<p>While you&#8217;ve got preferences open, find out what your computer&#8217;s local hostname is, you&#8217;ll need this later. You can find it in the text towards the top of the Sharing window, mine is <em>Grover-Cleveland.local</em>. By using this name to access your repository, you will be able to access the source even if the IP address of the server changes and you <em>should</em> be able to access it from outside your LAN if you&#8217;ve got <a href="http://www.apple.com/mobileme/features/mac.html">Back to My Mac</a> enabled with Mobile Me (I haven&#8217;t tested this yet).</p>

<h3>Accessing the Shared Repository in Xcode</h3>

<p>Open up Xcode. Hit <strong>Command-,</strong> to open Preferences. Navigating all the way to the right, you should see an <strong>SCM</strong> window. Click the &#8220;plus&#8221; sign at the bottom window to create a new repository. Give it a name, the name doesn&#8217;t have to be the same as what you set up earlier. Hit OK and create the new repository. In the URL box type the path to your subversion repository like so:</p>

<p><pre>svn+ssh://username@your-computer.local/Users/Shared/subversion/HelloWorld</pre></p>

<p>where username is your current login and <em>your-computer.local</em> is the address of your computer that we located earlier. For your first connection you&#8217;ll be prompted to add the SSH key and Xcode will ask to use your confidential information. Go ahead and let it, and you&#8217;ll be set!</p>

<p><a href=http://nothing2fancy.com/images/url_images/Xcode_Preferences-20090427-233951.png><img src=http://nothing2fancy.com/images/url_images/Xcode_Preferences-20090427-233951.png width=400></a></p>

<p>Read through the rest of Jeff&#8217;s post to get some more details on using Subversion and Xcode, or read <a href="http://developer.apple.com/mac/articles/server/subversionwithxcode3.html">Apple&#8217;s documentation</a> if you&#8217;d really like to go in-depth.</p>

<p>After a few weeks of using this system, there is no doubt that it makes the process of working on code from two different machines much more seamless. The one problem I&#8217;ve been having, and I&#8217;d be grateful if anyone knew a solution to this, is that the <strong>Commit All Changes&#8230;</strong> command will not work for me. I&#8217;ve got to go through, select all the modified files and commit them in batches. In order to commit the .xcodeproj file I need to use the <strong>SCM Results</strong> command to browse inside the .xcodeproj package and manually commit the files it contains. Vexing&#8230;</p>

<p>Anyway, I hope this helps some people!</p>

<p><strong>Edit:</strong> I&#8217;ve had some problems with the following error, <em>Error: 155005 (Working copy not locked; this is probably a bug, please report)</em>. After ignoring it for a few months and finally trying to figure out what&#8217;s wrong, I realized that you need to delete the &#8220;Build&#8221; directory from your repository after you delete it. After this you should have no problem doing full project commits from the menu bar.</p>

<h4>Footnotes:</h4>

<p><li id="84293">Now you know what I&#8217;d do if I had a million dollars<a href="#fn1" title="return to article">↑</a></li></p>
]]></content:encoded>
			<wfw:commentRss>http://nothing2fancy.com/2009/04/27/remote-version-control-with-subversion-and-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
