I want to store the source for my iPhone development projects on a remote Linux host using XCode's integrated source management. This gives me remote backup along with source management. XCode supports PerForce, CVS and Subversion, so git wasn't an option.
I want this to be a private repository, accessible through SSH, and I want to use the same repository for multiple projects.
There are plenty of posts and tutorials about XCode and Subversion, but none i found give comprehensive coverage to the configuration I want. Here's the procedure I eventually came up with:
1. Create a subversion repository (named svn) in my home directory on the Linux host.
[david@myhost ~]$ svnadmin create svn
2. Configure the empty repository in XCode
select SCM:Configure SCM Repositories
click + under the repository list on the left
give it a name and select Subversion as the SCM system
enter the URL:
svn+ssh://david@myhost.mydomain.com/home/david/svn
XCode will parse the URL, do not interfere.
Enter a user and password
3. Setup project directories
I want to use the same repository for multiple projects, so I created a directory for the first project. All the tutorials say to add branch, tags, and trunk, and keep the main line under trunk. As a lone developer whose repository will be non-public I ignored this and will store the main line directly under the root for this first project. Should the team need to grow beyond me, I'll just move it to a new directory with the conventional structure.
4. Import the project
Select the directory to import into. Click the Import icon at the top left of the Repositories dialog, and select the project directory to import. Do not double click! while navigating to the project directory, or XCode will accept the command with no confirmation, and import the entire directory tree. There is no way to cancel this command, except by quitting XCode (and ignoring the dire warnings it strews in your path).
5. Check the project out
In order to use XCode's SCM, the project has to be in a Subversion working directory. So close the project, then in the SCM:Repositories dialog, pick the checked-in project and click "Check Out". Select or create a new directory for your project and a new working copy will be created. Once you are sure this new copy is OK, delete the original project. From now on you will work in the new working directory.
That's it!
Comments