We have a project which has data and code, bundled into a single Mercurial repository. The data is just as important the code (it contains parameters for business logic, some inputs, etc.) However, the format of the data files changes rarely, and it's quite natural to change the data files independently from the code.
One advantage of the unified repository is that we don't have to keep track of multiple revisions: if we ever need to recreate output from a previous run, we only need to update the system to the single revision number stored in the output log.
One disadvantage is that if we modify the data while multiple heads are active, we may lose the data changes unless we manually copy those changes to each head.
Are there any other pros/cons to splitting the code and the data into separate repositories?
You can archive all your files in a repository, keeping any other versions or files, even if you aren't using them at the moment. Code repositories also give you a way to name or tag the different versions, keeping records of changes within the same project.
As a general rule you should keep your infrastructure next to the application code. So, yes you should have it in the same repository. Of course you might be in the case in which some resources are shared between different projects.
If your projects are independent, it's fine to keep them in separate repositories. If they share components, then put them together.
Multiple repos:
pros:
cons
One repo
For non-binary data, with infrequent changes, I would still keep them in the same repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With