views:

45

answers:

1

In the early stages of a project when lots of files are being added and the project is being worked on by more than one person concurrently, Xcode project files tend to come into conflict often under source control. Merging those is a pain and often results in lost file references if you're not careful.

Has anyone worked out a tried and true system for collaborating using a common Xcode project file? Does anyone keep a separate project file for each collaborator and worry about file dependencies when the problems arise? This seems like a pretty common problem, so I'm sure plenty of people have worked out a system for this type of thing.

I do have my own system for this involving separate project files for each collaborator, but that's kind of a bummer in the early stages...

+4  A: 

The best answer I have found is simply "Commit early and commit often." Don't wait until you've amassed a ton of changes to commit your work — when you add a new file to your project, check it in. When you move or rename a class, check it in. You get the idea…

The project format actually is fairly robust for automated merges. It's just that automated merges fall down pretty quickly when there are lots of small changes distributed all over the file.

The obvious caveats are:

  1. There are going to be periods of time where there is a bunch of half-baked clutter in TOT. You will want to start using branches and/or tags to keep track of "when things were good."
  2. For this to work, everyone on the team has to be on board with this. If you have any holdouts, their pain will be increased by the frequency of everyone else's check-ins.

My team works this way, and it works well enough for us. It's certainly no more painful than managing classic Makefiles, IMHO.

Kaelin Colclasure
+1 Where I work, this is how we do it, and it works well enough. We still have to occasionally merge by hand or re-do changes, but those are very rare occurrences if you follow this advice.
Dave DeLong
+1 on the "...everyone on the team has to be on board..." comment. The commit early, commit often model does seem to work well with small cohesive teams, but as numbers increase, the likelihood of someone being a d-bag and doing his/her own thing increases.
jtrim
+1 I've never had lost file references. If you're just adding files, keep both "mine" and "theirs" lines. If you're moving stuff around, wait until things have stabilized first (or ask *everyone* to commit, make your change, and ask *everyone* to update).
tc.