Question: My client's Salesforce codebase/metadata is fairly large and we're hoping to switch to SFDX.

Figuring out which components go into which artifact is going to be a challenge - I expect we'll have a "main" artifact with most of the components and then a couple of other artifacts for things that are clearly dependency free.

Anyway, I digress! Is the idea with SFDX that you would have 1 repo per artifact or should you have 1 repo with all artifacts in separate folders i.e. 1 repo per production org?

If it's the latter are there any sample repos out there with multiple artifacts?

Answer: 
Andrew Fawcett has provided us with [an open source demo](https://github.com/afawcett/dx-di-demo) you can clone and peruse.

Generally speaking, all of the artifacts related to your application should exist in one repo. This allows you to have dependencies and help automate the deployment process.

Of course, the general exception is that you have a repo so large that it takes forever to push, pull, clone, etc, it might be worth it to split it up into multiple repos. This generally complicates matters and should only be used as a last resort.
On our ISV project we use **"NVIE" git branches**

<https://nvie.com/posts/a-successful-git-branching-model/>

So **one repo** , but **multiple branches** :)

We also have one SFDX Project ( folder ) by "artifact"

* **Source** :
	+ Dev branch (and its sub-branches for developments)
	+ Quali branch
	+ Pre-prod branch
	+ Prod branch
* Packaging : managed package, ISV specific, not applicable to clients not building ISVs

If you need to deploy only parts of SFDX project into an org, you can filter it using your own package.xml files and this [sfdx metadatas filtering plugin](https://github.com/nvuillam/sfdx_metadatas_filtering)

* **Publishing** in Dev branch is made via **Pull Requests** from Dev Sub branches
* **Merging** of branches from Dev to Quali , Quali to Pre-prod , Pre-prod to prod can be managed automatically with **Jenkins Jobs**