views:

9253

answers:

8
+10  Q: 

SCM for Xcode?

I am developing an application for the Mac as a small team (me + another person) effort. We are located in different cities, and have started to see the need for solid source control management.

None of us have any experience with this, and both of us are relatively new to Cocoa/Obj-C/Xcode (but do have C knowledge).

Does anyone have any recommendations as to which SCM system to choose? I understand that a lot of people are using Subversion, which is also supported in Xcode 3.1. Does anyone have experience with using Subversion through Xcode? Or is it a better option to chose a stand alone GUI alternative, such as Versions?

Grateful for any input on this.

Gregor Tomasevic, Sweden

Update/personal experiences: Since this post, we have tried Versions and Cornerstone (both of which are SVN GUI-clients), as well as Xcodes built-in support for SVN. We were not particularly pleased with Versions, which seemed to have some problems with committing unversioned files/build files. The built-in SVN support in Xcode works quite well, although it probably has limitations that we have still not run into. Cornerstone is both simple to use and powerful, and does not seem to suffer from the problems we encountered with Versions.

So far, we have just tried committing, updating repo, checking out latest/previous versions of our files and worked some with file comparison. It might be a whole different ball game once you start working extensively with branching, an area which we have been told both these GUI clients might have some weaknesses in.

For what it's worth (and with only days of evaluation) Cornerstone seems to be a somewhat better alternative, although for simpler SCM, Xcode works well too.

Thanks for all the comments.

+1  A: 

If your going for subversion, I've heard good things said about Springloops. I code together with some friends too in a similar fashion and we use Github. Git is such a wonderful experience. I don't use any GUI for it since I'm much more efficient with a shell prompt. But of course, I'd welcome if XCode had support for Git repos.

PEZ
+5  A: 

Xcode's Subversion support is pretty good. 90% of the SVN activities I perform are easily doable from Xcode. For the other few things I just fire up Terminal.

There are a couple things in their SVN client implementation that are annoying:

  • The code that checks to see which local files have been modified seems to run on a background timer, and its pretty latent. Sometime it takes 5 minutes for Xcode to show a file as modified. The same thing is even more exaggerated w/r/t remote modifications.
  • Sometimes when you rename or delete a file that isn't under source control, a dialog will appear, asking "Do you wish to [rename/delete] this file in SVN as well?" And the options are "Yes" or "Cancel." You choose Yes out of desperation only to be presented with a well-deserved SVN error.

Overall, I'd recommend it.

David Grant
+10  A: 

Xcode only supports Subversion, Perforce, and CVS. However, there are also distributed version control systems out there, such as Mercurial, Bazaar, and Git. These have no Mac-native GUIs, but you should still consider them. Personally, I love managing my projects in Mercurial repositories.

Peter Hosey
I've heard (but not tried yet) of gitX (http://gitx.frim.nl/) for a git GUI.
mouviciel
There's also Murky (https://bitbucket.org/snej/murky/) for Mercurial.
Peter Hosey
GitX is really good, and Murky is decent also. They both have their own takes on the UI, but they're good tools, both of them.
RyanWilcox
+2  A: 

Subversion is the traditional OS X source control solution, in Leopard it's supported in Xcode and OS X, not to mention the third party GUI apps (a few of which look very slick). Despite all of this though, a lot of the independent OS X developers have switched to Git over the past year or two. As a single developer I can tell you Git has turned out to be a very good solution for me, and along with Github it makes a great solution for a small team effort.

Marc Charbonneau
+3  A: 

Caveat: If you simply tell XCode to add a project to a repository by giving it the top-level dir, it WILL add the build directory to the repository, which of course is a terrible thing to do.

In order to get around this you have to move the build dir to another location so that XCode won't try to import it, or manually add the discrete folders of a project one by one.

Genericrich
Just add the top level directory, then remove the build directory from the repository. It is annoying, but pretty easy to get around.
kubi
I create the project, make it completely clean (remove build directories), then do my first commit (add or whatever). Later, when the build directory is created, svn just ignores it (puts a ? next to it) because I never added it.
Lou Franco
+4  A: 

You can't really go wrong with using Subversion.

If, like me, you don't like Xcode's SVN integration too much you can always choose to use the command-line tools, or one of the several GUI apps like Versions, CornerStone or SvnX. Most of these tools work together pretty well, so you're not necessarily tied in to the tool you start out with.

I personally do most of my work with Versions, and use the command-line tools with the same working copies every once in a while.

If you're comfortable working with command-line tools exclusively until someone creates a good GUI app around it, git is a pretty viable option too.

disclosure: I'm one of the people who work on Versions, so I might be slightly biased ;)

Dirk Stoop
You use Versions? There's a surprise! ;-)
Abizern
Subversion is so last century. DSCM is a superior paradigm.
foljs
A paradigm by itself does not make for a great workflow.  The mere fact that you can choose between the command line client, Cornerstone, Versions, SvnX, etc. gives SVN a very tangible advantage.
Dirk Stoop
@foljs: so real-world software engineers have a century more experience with centralised SCM? ;-)
Graham Lee
A: 

Mercurial (like git) is "distributed" and perhaps regarded as more modern and up-and-coming than svn (but less established). If you want to auto-checkin using mercurial, you can add the line:

hg commit -m "Xcode auto commit"

as part of a "Run Script" stage of the XCode build, as found in: Project > New Build Phase > New Run Script BUild Phase

Greg
Ooh, bad advice. Checking in every time your code builds is stinky; checkins will be limited to single files (file grouping gives a natural hint as to the checkin's meaning), besides which not every code change that builds is worth keeping! Finally, you will end up with thousands of checkins all with the same log entry, making it difficult to find a specific change down the road. -1 in spirit, though I don't feel mean enough to actually downvote you--you did recommend Hg, after all.
Tim Keating
+6  A: 

There is a nice GUI frontend for Mercurial on Mac called MacHG: http://jasonfharris.com/machg/

It is free and very nice IMHO.

nushoin
The landscape has shifted since this question was first posted, and while it's great that Apple's putting more effort into SCM integration with Xcode4, MacHG still beats every other visual SCM client I've seen to-date—Xcode4 Dev Preview 2 included—hands down.So while Gregor is probably feeling entrenched with svn by now, any newcomers should try the combination of Mercurial (i.e., hg) + MacHg + http://bitbucket.org (if you need an equivalent to github).
clozach
Seconded! I have been experimenting with distributed version control as well, and recently discovered MacHG. It's so good, I miss it when I'm working on Windows! (And that's even WITH TortoiseHG.)
Tim Keating