Thursday, March 28, 2019

Help structuring Git repositories.

This is more of a general "structural" question, I suppose... but I wasn't sure where else to ask it. So here goes.

I'm looking into doing some restructuring of my current project repositories in Azure Devops. My (simplified) directory structure looks something like this:

C:\VS\Projects\LibA \LibA.sln \LibB \LibB.sln \ApplicationA \ApplicationA.sln \ ... 

Where LibA, LibB, and ApplicationA are all applications written in C# and WPF and what have you. Now, let's say that ApplicationA has project dependencies on LibA and LibB, which are then included in ApplicationA's solution. EDIT: LibA could also be a utilities library which is used by many applications. So it's not only a dependency of ApplicationA, but ApplicationB, C, etc..

So, here's the question:

Should I create a single Git "monorepository" in the Projects folder which will include LibA, LibB, and ApplicationA? Or should I create smaller repos for each of LibA, LibB, and ApplicationA?

Right now, I'm using the "monorepository" option as I'm a solo developer and it makes it much easier for me to open up the solution for ApplicationA and, if necessary during debugging or tuning a feature, change LibA and LibB from that solution. Then I can just push the changes from the whole repo to Azure and I'm good to go. The disadvantage to this approach is I lose project level history. A change to ApplicationA will show up as a change to the entire repo, which can make changes difficult to track.

Before, I was using the per solution repo, with a Git repo for LibA, one for LibB, and one for ApplicationA. This made project level history and changes easier to track, but if I changed LibB from within ApplicationA's solution, I had to remember to go into LibB's solution and commit the changes. It was a bit of a maintenance headache.

Plus, I recently had to pull a good portion of my projects from Azure Devops onto a laptop to take with me to work. I had to go through each project, find its dependencies, manually clone each repo from Azure Devops, etc... it was kind of a pita.

Am I doing something wrong here? Is there a better way to do this? I appreciate any input!

Help structuring Git repositories. Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team