gitazure-devops

How do we store files shared across projects stored in separate VSTS GIT Repositories


We're about to migrate from a monolithic SVN setup to individual GIT repos on VSTS and we are having trouble working out the best strategy to store code and image files that we reference across many of our projects.

We're new to GIT so we wanted to get this right first time!

For example we have a library of icons that we use across many of our projects as needed so we have a similar look and feel to settings windows etc.

We also have a fair number of .vb and .cs files that we "add as link" in visual studio to some projects as needed - for example if a project needs extensive debug logging we add in a debug.cs file, it if needs licensing we add in licensing.cs and so on.

Several of these static linked files need to be in the final assembly not in a separate assembly so we can't put them into a single central "AllSharedBits.DLL"

What is the best way to store these files in VSTS - I read that submodules might be an option, but am I right in thinking that we then have to manually add a link to that secondary repository to each project?


Solution

  • Option 1: manage reference files into the same git repo with your project

    If the reference files are not update (unnecessary to manage the versions), and the files are only used for the projects, then you can manage these files into the same git repo.

    If you need to manage the version of the reference files, and they may referred by other project, then you can use Option 2 or Option 3.

    Option 2: manage reference files into a separate git repo

    You can manage the reference files into a different git repo, and then treat the git repo as the submodule or subtree for the migrated git repo.

    Option 3: manage the reference files as nuget packages

    Or you can manage the reference files as nuget packages, and then add the related packages for your projects.