views:

3241

answers:

9

It seems that all of the initial Google results for "using subversion with xcode" are actually just tutorials for installing and configuring svn and Xcode, as opposed to actually using the two (i.e. interacting with svn via Xcode's GUI).

Is anyone aware of a good guide that teaches the tricks and pitfalls of working with svn via Xcode's GUI? Something that bridges the gap between the most excellent Version Control with Subversion book and the Xcode IDE (as in pure Xcode GUI without any terminal command use)?

Edit:

We all love our terminal commands, and we all love Eclipse but (and I mean this in the nicest possible way) neither is really the point of the question. I’d prefer to use svn via Xcode’s IDE instead of via terminal just as I prefer (well, for this case) to code in Xcode’s IDE instead of using vim and gcc. Apple engineers spent a good bit of time implementing that SCM menu in Xcode; someone has to have seen a usage guide somewhere.

+3  A: 

I know this is not quite what you asked, but I wouldn't rely much on the use of SVN from Xcode as what you can do with it is very limited. It's useful for being able to do a diff or annotate direct from the IDE but not a great deal else. I don't think it's any substitute for using a separate standalone client such as SmartSVN or Versions.

You also have to jump through a number of hoops to get Xcode to work with SVN version 1.5 onwards, so that's something to be aware of before installing a standalone client. If in doubt, check out a sandbox first.

the_mandrill
Maybe I’m a little fuzzy on what you mean by getting Xcode to work with SVN 1.5 onwards, but my experience has been very smooth. SVN 1.6 comes prepackaged with Snow Leopard, and through the use of just two simple tutorials (http://www.rocxsoft.com/default.asp?W22 and http://iphonedevelopment.blogspot.com/2009/03/version-control-is-your-friend.html) SVN 1.6.2 is talking to Xcode 3.2.1 wonderfully on my machine. I’ve tackled the usual tasks just fine (import, export, commit, update, diff, etc.). It’s just the less common SVN tasks for which I’d like to find an Xcode-centric guide.
Kevin L.
I didn't realise that Snow Leopard comes with 1.6. That makes life much easier. If you're using Leopard then you're stuck with SVN 1.4, so then you need to install the OSX build of 10.6 from Collabnet and modify your PATH.To my knowledge, I don't think Xcode has much functionality beyond commit, diff, update, log, etc, and so for other operations such as branching and merging you're best off using a separate client. You can still use Xcode's SVN features while you're using another client, as long as both use the same underlying SVN version (eg SmartSVN 6 = svn 1.6)
the_mandrill
I haven't seen a specific usage guide for the SVN features of Xcode. I think the limited functionality that exists was sufficient for the Xcode devs to tick a box and say 'yes, it supports SVN/CVS/Perforce'. The functionality is so limited that I don't think there would be a dedicated guide for it (the best I've found is [here](http://developer.apple.com/tools/subversionxcode.html) ). I don't think the intention was for Xcode to be a fully-featured SCM client, rather just to support simple checkout/update/commit workflows.
the_mandrill
+5  A: 

I second the comment by the_mandrill, SVN support from within XCode is very limited, especially if you're used to Eclipse.

I also don't understand why everyone seems to need visual clients. I keep a terminal window open on my project directory and I have no problems interacting with SVN from the command line.

Rui Pacheco
I agree. Sometimes people think people who prefer terminals for certain tasks are just being elitist, but it really is a simple process, especially since version control commands are usually relatively simple, it's a lot quicker and easier to keep track of things as your project progresses by using the terminal.
Jorge Israel Peña
For simple operations using svn from the commandline is easy enough, but when you want to do things like cherry-pick files for adding to changelists, or do selective commits, or 3-way conflict resolution, or see the branching structure then having a visual client is well worthwhile. AFAIR, I don't think Xcode does any of these, incidentally.
the_mandrill
I think there are times when having a visual client is worthwhile but xcode just does not give you any real gains over the CLI. In fact I haven't really found any great GUI clients for svn on the mac (I'd love to be proven wrong).
Nick
using Terminal isn't "wrong" - but if you want everything in one place, it is
warren
What do you mean? The terminal makes me run for the documentation often but apart from that its all there.
Rui Pacheco
@Nick Have you tried Versions?
Rui Pacheco
DTerm is a great little "instant command line" utility that's really handy for interacting with SVN/git from inside Xcode. http://www.decimus.net/dterm.php
amrox
A: 

if you want to work with svn through a gui interface then i suggest you use eclipse + subclipse plugin (which have more features and much more reliable and easy than svn on xcode)..

you will work in xcode as normal but you will use eclipse only as an svn client (by creating a general project in eclipse and make it points to your xcode project directory )

and here is a tutorial of how to install subclipse

Ahmed Kotb
Very tempting, and my favorite so far.
Kevin L.
-1 for suggesting changing IDEs just to get an SVN client
Casebash
A: 

As has been mentioned in many other answers, the svn client with Xcode is quite weak (and that is being kind).

Personally, I think that running Eclipse just to get access to a svn client is a bit heavy handed.

I would suggest two answers:

  • Use a dedicated svn client for the Mac (Versions and Cornerstone are both very good, albeit not free... there are free ones, such as svnX)
  • If you are not wildly comfortable with the terminal, you can script a couple of the key commands that you want to use and add them to your Xcode user scripts folder, then you can trigger them from a menu item of from a keystroke, just as if you were using the Xcode native client. There's a ton of examples on how to do this available via Google.
mmc
+3  A: 
Oz
a little daunting, but doesn't look *too* bad :)
warren
Newer version of the linked-to document: http://developer.apple.com/mac/articles/server/subversionwithxcode3.html
outis
A: 

I came across these - no idea how well they work, but wanted to add some resources if I could:

warren
A: 

Has someone succesfully imported existing Xcode project to subclipse? And using subclipse to perform commits and merge conflict handling?

Simo Salminen
+1  A: 

A lot of people have problems using the build in svn client, especially to get a new project into svn and that it works.

I created a straight foreward tutorial on how to do this, along with a very well known pitfall (works for Xcode up till the latest version of xcode incl. Iphone 4 sdk)

http://www.sodeso.nl/?p=599

ronaldmathies
+1  A: 

Here is one of the best tutorials to configure subversion in XCode - http://iphonedevelopment.blogspot.com/2009/03/version-control-is-your-friend.html

It also teaches even to create repository in local MAC.

Sagar