views:

594

answers:

10

It sounds to me like subversion's centralized model works better for web application development where you have a team of engineers working currently on the same code base and releasing constantly.

On the other hand Git's distributed model is appealing for an IPhone app because 1) I dont' need a connection to browse the repository 2) it's a lot faster 3) development will be shared but not as often.

Sorry if I answered my own question and I don't mean stir a debate, feel free to give single line answers.

+1  A: 

Svn support is built into Xcode. You can install a newer client manually.

Alex Reynolds
svn support in Xcode is weak to say the least. I don't think that this should be a consideration.
mmc
Can you comment on what is weak before dismissing the answer?
Alex Reynolds
+6  A: 

I'd vote for whichever one you had configured in your shop.

Wyatt Barnett
That's a good answer... although as embarrassing as this may sound we are still on CVS. We are moving to Subversion for the main app.
Artilheiro
Well, CVS is better than a) no source control or b) Visual Source [un]Safe . . . .
Wyatt Barnett
Setting these things up is always a pain so that is an important consideration.
Artilheiro
Converting from CVS to Subversion is fairly simple. Haven't done a git project, so I can't comment on that end of things. Only tricky bit about CVS->Subversion is properties, and I've pretty much decided to set those explicitly after the fact, easier, more transparent, and less reliant on people I don't know doing the right thing.
Mike Burton
A: 

How do you upgrade the svn client in XCode? I've done this in the past to go from 1.4 to 1.5 but it was tedious, difficult, not documented, and glitchy. I've since tried to back out my hack (which broke my Apache server) and now I can't use it at all. This is after upgrading to the latest XCode which is supposed to support 1.5 natively.

Cliff
+2  A: 

While Xcode has SVN integration, I find it to be an extremely poor implementation. You can check out (sorry for the pun) the excellent Versions if you'd like an alternative.

Having said that, I'm basically a one-man shop (although I use two machines) and I find git to be much nicer to use.

jbrennan
+2  A: 

I am a one man shop when it comes to iPhone development, and I use Mercurial (which is very, very similar to git). My deciding factor was simply that I wanted to learn to use a distributed source management system.

The primary difference if you are a one man shop is that code branching and merging is much easier in git/Mercurial. A minor difference is that svn repositories take up much more disk space (but on an iPhone project, this is not terribly likely to be a major issue). Other than that, you are not likely to notice that much of a difference.

mmc
+2  A: 

One thing you should realize about distributed vs. centralized VCS is that a distributed one can do everything a centralized one can. With git, you can have a single public repository, the authoritative version of the code, managed in any number of ways - for example, if all of the developers can push to it, it gains everything you want about a centralized VCS, except with all the added benefits of git and none of the inadequacies of CVS/SVN.

Jefromi
+2  A: 

Here's my general advice on source control. Subversion is by far my favorite tool, and the one I have the most experience with. That said, the first thing I do on any workstation is download and install SVK, which gives you disconnected access to subversion repositories (since I predominately work from a laptop, sometimes in a park or my backyard with no wifi access).

Subversion+SVK gives you most of the benefits of git or mercurial or bazaar (though I am evaluating those as well). I think future development of Subversion is going to add SVK/git/Hg capabilities to support the DVCS use case.

So I would advise NOT deploying git if you're already using subversion, and instead grab SVK and get going with that (plus it's pretty mature, it's been around for a few years now). Downside is it can be slow at times (written in perl).

Download SVK

Chris Kaminski
I thought the main sponsors of SVK were backing out of it: http://lists.bestpractical.com/pipermail/svk-users/2009-May/000425.html and by implication you should go use a dedicated distributed vcs - such as git, mercurial, bzr, darcs, ...
dajobe
A: 

I can't really give you a clear answer because I've not used CVS or Subversion for some time - but I have used Git projects with other iPhone developers and it works quite well.

The only potential peril is that sometimes you have to resolve merge conflicts in the XCode project if more than one person is adding new files - but I would think SVN would have similar issues.

If you do use git, github.com works very well as a repository - and they have a great set of documentation for working with Git on the Mac (you could just visit that part of the site to get set up).

Kendall Helmstetter Gelner
+7  A: 

Definitely git. I've learnt two new things this year: iPhone programming and git. Whilst iPhone programming has made me hate my life, git has improved the way I develop software. The painless branching has meant that I can make a branch for everything, without telling the rest of the world, and when I'm completely satisfied with it I can merge it back into our wonderfully stable master/trunk.

It's great, there's no pressure to release anything that isn't ready and seeing as you can check in locally, it's easier to sculpt small, useful commits.

I'm still undecided on the iPhone thing.

Rhythmic Fistman
+1  A: 

If there's no one forcing you to use svn, then you should probably use git, since git can interoperate with svn (which means, technically, you could use git while the people you are working with use svn; that's probably too much trouble though).

As for XCode integration, git has none but it is not too hard to get git working using some keystrokes in XCode. I wrote some scripts that will do it for the most frequently used git commands and placed them in user scripts. Here are two examples:

git initialize

#!/bin/sh
# 
# This script initializes a git repository and adds all the elements 
# of the project directory to the repository


# Set the basic variables of the script.
project_directory=`osascript << APPLESCRIPT
tell application "Xcode"
    set mypath to the project directory of project 1
    set mypath to the POSIX path of mypath as string
end tell
APPLESCRIPT`  

cd $project_directory

# create the git project configuration files
cat << EOF > .gitignore
.gitignore
.DS_Store
.gitattributes
build/*
EOF

cat << EOF > .gitattributes
*.pbxproj -crlf -diff -merge
EOF 

/usr/local/bin/git init
/usr/local/bin/git add *

git add

#!/bin/sh
# 
# This script does a git adds a file of the user's choosing
# to the git repository.


# Set the basic variables of the script.
project_directory=`osascript << APPLESCRIPT
tell application "Xcode"
    set mypath to the project directory of project 1
    set mypath to the POSIX path of mypath as string
end tell
APPLESCRIPT`  

files_to_add=`%%%{PBXUtilityScriptsPath}%%%/AskUserForExistingFileDialog "Add files"`

cd $project_directory

/usr/local/bin/git add $files_to_add

You can see a pattern here that will allow you to quickly write up the others. Inside the "user scripts" dialogue, you can assign key sequences to the commands. I find that in everyday use I rarely need to go to the command line to use git.

Pinochle