Answers: <p>This is something I also struggle with. I can tell you from experience it depends on the type of application and the tech stack being used. The short easy answer is that having everything in one repo is usually not the wrong or hard way. Breaking things out often doesn't offer many benefits but again it will all depend on your CICD engine and what kind of application and what tech is being used.</p>
  <p>Here recently I had a project that had 3 repos. 1 for a CLI application. 1 for the infrastructure as code being deployed by the CLI and 1 for a library that was used by the CLI application and other tools.</p>
  <p>This all seems straight forward and a good choice but the CICD has been really pain full.</p>
  <p>Often a new feature will span across 3 repos. Trying to get this to work in CICD is impossible as far as I can tell. I would much prefer to have the infra and CLI together as most new features affect both codebases.</p>
  <p>Then I could at least get a list of the changed files in the CICD pipeline and decide if I need to test the infra or not.</p>
  <p>The other issue when you split things up like this is trying to version these different parts and understand what versions work with other versions etc.</p>
  <p>I guess to sum it up would be if things depend on each other then keep them in the same repo as it really helps the CICD process. Think an application and its underlying infra. Now would I combine a rest api and its client? probably not, in the past I just required the branches be the same name. So in CICD I would check if the other repo has a branch of X and if so use it and if not use master. If things are mostly independent like a library and a application that uses it, then keep it split up.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-06-13T07:38:50.163Z
Answers: 2021-06-13T07:38:50.163Z
Answers: Levi
Answers: <p>There's no easy answer to this, get your repos too big and every branch becomes huge over time, make it too small and you end up doing a lot of administration.</p>
  <p>Many smaller repos has my preference, but only after creating some support scripts to do the administration for you.</p>
  <p>For example, to pull all repos:</p>
  <pre><code>ls -d **/ | xargs -P12 -I{} git -C {} pull
  </code></pre>
  <p>Also git has a feature built in for repos, submodules.</p>
  <p><a href="https://git-scm.com/book/nl/v2/Git-Tools-Submodules" rel="nofollow noreferrer">https://git-scm.com/book/nl/v2/Git-Tools-Submodules</a></p>
  <p>They come in handy when a repo references another but does not to do source control on the other. It comes with its own subset of commands.
  It's worth looking into this</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-06-14T06:59:41.057Z
Answers: 2021-06-14T06:59:41.057Z
Answers: Serve Laurijssen
Body: <p>We are developing an Azure-based analytics platform that consists of several modules. Among other things, Azure functions, scripts for creating the infrastructure and scripts for initialising the database structure including the creation of stored procedures are used.</p>
  <p>Currently, the repository structure is a bit messy and I was asked to clean it up and develop a strategy for deploying and updating individual parts of the platform (We currently redeploy the entire platform with every release).</p>
  <p>What is the best way to implement this at repository level? For example, do I create a separate repository for each Azure function and the associated pipelines, or do I put them all in a common repository and try to solve this via individual release branches for each Azure function?</p>
  <p>Any other best-practice approaches?</p>
  
Tags: <azure-devops><git><azure><azure-pipelines><repository>
Title: One or multiple git repositories for independent small parts of one larger project?
UserDisplayName: MarcoCodo
ThreadText: # One or multiple git repositories for independent small parts of one larger project?
  
  (Asked by: username_0 on 2021-06-10)
  
  We are developing an Azure-based analytics platform that consists of several modules. Among other things, Azure functions, scripts for creating the infrastructure and scripts for initialising the database structure including the creation of stored procedures are used.
  
  Currently, the repository structure is a bit messy and I was asked to clean it up and develop a strategy for deploying and updating individual parts of the platform (We currently redeploy the entire platform with every release).
  
  What is the best way to implement this at repository level? For example, do I create a separate repository for each Azure function and the associated pipelines, or do I put them all in a common repository and try to solve this via individual release branches for each Azure function?
  
  Any other best-practice approaches?
  
  **Tags:** azure-devops, git, azure, azure-pipelines, repository
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-06-13. Score: 1
  
  This is something I also struggle with. I can tell you from experience it depends on the type of application and the tech stack being used. The short easy answer is that having everything in one repo is usually not the wrong or hard way. Breaking things out often doesn't offer many benefits but again it will all depend on your CICD engine and what kind of application and what tech is being used.
  
  Here recently I had a project that had 3 repos. 1 for a CLI application. 1 for the infrastructure as code being deployed by the CLI and 1 for a library that was used by the CLI application and other tools.
  
  This all seems straight forward and a good choice but the CICD has been really pain full.
  
  Often a new feature will span across 3 repos. Trying to get this to work in CICD is impossible as far as I can tell. I would much prefer to have the infra and CLI together as most new features affect both codebases.
  
  Then I could at least get a list of the changed files in the CICD pipeline and decide if I need to test the infra or not.
  
  The other issue when you split things up like this is trying to version these different parts and understand what versions work with other versions etc.
  
  I guess to sum it up would be if things depend on each other then keep them in the same repo as it really helps the CICD process. Think an application and its underlying infra. Now would I combine a rest api and its client? probably not, in the past I just required the branches be the same name. So in CICD I would check if the other repo has a branch of X and if so use it and if not use master. If things are mostly independent like a library and a application that uses it, then keep it split up.
  
  
  ---
  
  ### Answer by username_2 on 2021-06-14. Score: 0
  
  There's no easy answer to this, get your repos too big and every branch becomes huge over time, make it too small and you end up doing a lot of administration.
  
  Many smaller repos has my preference, but only after creating some support scripts to do the administration for you.
  
  For example, to pull all repos:
  
  ```
  ls -d **/ | xargs -P12 -I{} git -C {} pull
  
  ```
  
  Also git has a feature built in for repos, submodules.
  
  <https://git-scm.com/book/nl/v2/Git-Tools-Submodules>
  
  They come in handy when a repo references another but does not to do source control on the other. It comes with its own subset of commands.
  It's worth looking into this
  
  
  ---
  
  