Alex Rivera | Logout

Should Git Repo's be at the Solution Level or Project Level in Visual Studio

Asked 2009-07-07T19:47:52.790
59

If I have a C# solution with multiple projects in it, what would be better, to have the Git repo created in the solution folder, or in each individual project folder? Multiple developers will be working on the projects. What are your experiences with this?

Edit
Report

2 Answers

28

I use several (sometimes overlapping) solutions to contain a collection of related independent applications and shared libraries. As others have mentioned, you really don't want to have a single Git repository containing the source for multiple, independent projects as it makes it much too difficult to track isolated changes.

So, if your solution is structured as mine is then you will definitely want individual Git repositories for each project. This has worked well for me for ten to twelve applications and doesn't create as much maintenance overhead as you might think.

If your solution is truly monolithic (and you're sure you want it that way forever and ever), then it probably makes sense to only have a single repository.

answered 2009-07-07T20:29:21.567
12

It depends. git repositories are most suited to containing a single configuration item with its own independent lifecycle. If your projects have their own release cycle and are shared between multiple solutions then it might make sense to have them in their own repositories. Usually, though, it is the solution that represents a configuration item with all the constituent projects forming part of the same build. In this case a single git repository at the solution level makes more sense.

answered 2009-07-07T20:20:36.810

Your Answer