tags:

views:

23

answers:

2

I am fairly new to Git and am curious if anyone sees an issue with having the code for both my web application and client (iPhone) app under the same Git project.

I was thinking of creating a folder structure for git like the following:

MyProject
    ServerSide_Code
    iPhone_Code

Should these be broken out into separate projects? Can I break out one of them later on and keep their commit history?

A: 

It depends on your development workflow.

With Git, the thing you need to keep in mind is that users need to download the entire repository history when the checkout (clone) the repository. If you have separate teams doing server-side and mobile development, they might not be interested in what the other team is doing. Having to checkout the entire history (particularly for a large project) might be a bit of a burden.

On the other hand, having both projects in the same repository allows cross-project atomic commits. For example, the same commit can simultaneously change the protocol provided by your server-side app while updating the mobile app to use that protocol. Without this, there's a small window where the server side code would be out of sync with the mobile app, potentially causing breakage. Again, mostly an issue for larger teams and larger projects.

Edit: To answer your second question, it's difficult to strip out history from one project and add it to another, but not completely impossible.

Trevor Johns
Yes, this is just a 2-3 person operation. The part about changing a protocol for both apps at the same time was on par with what I liked about putting them together. I just wanted to make sure I wasn't heading into a mine field of gotchas by choosing this path.
SonnyBurnette
A: 

I would keep them as two separate repositories (personally) - but it depends on how you plan to develop and release this.

To answer your second question: http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository

The best method - IMO - if you wanted to keep these organized create two repos for each folder then a third parent repo which will be able to track the sub- repos

Project (Git)
 - Server (Git)
 - Client (Git)
Marco Ceppi