Best way to version control a WCF application with Git?
- by Sam
Suppose I have the following projects. The format is [ProjectName] : [ProjectDependency1, ProjectDependency2, etc.]
// Service
CoolLibrary
WcfApp.Core
WcfApp.Contracts
WcfApp.Services : CoolLibrary, WcfApp.Core, WcfApp.Contracts
// Clients
CustomerX.App : WcfApp.Contracts
CustomerY.App : WcfApp.Contracts
CustomerZ.App : WcfApp.Contracts
(On a side note, WcfApp.Contracts should not depend on WcfApp.Core, right? Else CustomerX.App would also depend on and thus be exposed to the service domain model?)
(CoolLibrary is shared with other applications, so I can't just put it inside of WcfApp.Services.)
All of this code is in-house. I was thinking of having 6 repositories for this. The format is [repository folder name] : [Projects included in repository.]
1. CoolLibrary.git : CoolLibrary
2. WcfApp.Contracts.git : WcfApp.Contracts
3. WcfApp.git : WcfApp.Core, WcfApp.Services
4. CustomerX.App.git : CustomerX.App
5. CustomerY.App.git : CustomerY.App
6. CustomerZ.App.git : CustomerZ.App
How should I manage my project dependencies? I see three options:
I could use binaries which I have to manually copy to each dependent repository. This would be easiest at the start, but my repositories would be a little bloated, and it'd become more tedious as I add more client apps for customers.
I could import dependent code as submodules. This is what I will probably end up doing, although I keep reading on the web that submodules are a hassle.
I also read that I can use something called the subtree merge strategy, but I am not sure how it is different from just cloning the repo into a subdirectory and adding the subdirectory to .gitignore. Is the difference that the subtree is recorded in the master repository, so (for example) cloning it from a different location will also pull the subtree?
I know I asked a lot of questions in this post, but the most important two questions I have are:
1. Am I using the right number and layout of repositories? Should I use less or more?
2. Which of the three dependency management strategies would you recommend? Is there another strategy I haven't considered?