开发者

Separate Web Server from Client App in Git?

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?


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: Detach (move) 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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜