views:

11

answers:

2

Hello nice person!

I have never used version control in my life. A friend of mine wants me to access his project on my machine using Xcode. All he has given me is a URL. So, the question is: how do I get said source code?

Thank you ;)


EDIT 1

Please keep in mind I just need to download the source code. I don't have to do any updating or version control myself. I would think that this should be simple enough, like log in here, download there, etc. no?

A: 

You should really take a quick look at the Subversion book, particularly the "Subversion In Action" section of the Fundamentals chapter. It's short and concise. I'm not familiar with any XCode integration, perhaps another answer can provide more advice...

Edit: If you already have the svn client installed, you can use the "svn checkout {url}" to get the source. Also, since the Subversion network protocol is HTTP-based, you can usually use your web browser to get at the individual files, by visiting the repository URL (assuming your friend is exposing the repository via HTTP, and not svn+ssh). Of course, this won't get you all of the files in one blast- you will need the Subversion client to do that. Fear not, though, the client is pretty lightweight.

joev
Thanks, but a bit more specific answer would be appreciated though. Please see my edit.
Eric Brotto
+1  A: 

First, if you are unfamiliar with svn, its best to brush up on that before starting this. There are many many source within google reach so I won't dwell on that here. Now, on to Xcode...

Before you can reference a repository you need to se it up. Here is how:

In Xcode select Preferences from the Xcode menu and choose the SCM tab from that window. That area will list the repositories you have set up, presumably none at this point. Add a repository by clicking the plus sign on the bottom left under the repository list. Give it a name (your choice) and set the SCM System to be subversion. Clicking OK will bring up an empty template for the server settings. You can fill this out by entering the entire URL with username, or ignoring the URM field and filling in the other details.

Note : assuming you do this field by field, I strongly recommend putting in the scheme (i.e. https) last to prevent Xcode from attempting to log in before the info is complete. It will basically try and authenticate on the fly, and on several occasions this has caused account lock-outs when it tried to authenticate multiple times with incomplete passwords.

If all went well, there will be a little green light under password with the word Authenticated beside it.

At this point the repository is set up. You should be able to browse it and work with it by selecting Repositories from the SCM menu in Xcode. From there you can checkout the projects you like.

Once you have a project directory that you have checked out from subversion you can set it up to show the status and do check ins etc from Xcode. This is very simple - it is just not very obvious.

  1. Open the Xcode project from the checked out directory.
  2. Right click on the project file inside Xcode at the very top of the Groups & Files list and select Get Info from the context menu.
  3. Select the General tab at the top of the window that comes up and click the button marked "Configure Roots & SCM".
  4. That will show a list of repositories - if the list is empty click the plus sign to create one.
  5. The root should be your project area. If you don't do anything you should see "" in the field - this works for most setups.
  6. The repository field will have a drop down box with any configured repositories Xcode knows about. Select the one that you set up for our subversion area in the previous steps above.
JeffW
Given your last edit, if you really just want to download source code and thats it, the above is probably overkill for now. If the server you are after supports anon checkout and http, something like this should work which would check out 'proj' to 'localproj': svn checkout http://some.server.com/path/to/proj localproj
JeffW
I followed your first set of instructions and it worked perfectly. Thanks!
Eric Brotto