Best practices for source control, libraries and dependencies

Hi,

I have a project which uses several libraries and I am considering adding them as Git Submodules to the main project Git repo. I am curious if others on the forum are doing this, or if you are relying on the native Particle library install process solely. If the latter, are you including your imported libraries in your source control repo?

Thanks.

There are different schools of thought here. Personally, I include my libraries in the repo. This is partly because I sometimes need to modify them, or in one case nearly rewrite it. It also gives me version control, so if I clone the repo on a different machine I know it will compile cleanly and that the library hasn’t been updated with changes that break my code. I don’t include them as submodules.

1 Like

Hey Nolan,
I also include the libraries in my git repos for the same reasons mentioned by Reid above.
I find git submodules a pain to work with, so I just avoid them in general (my opinion).
Good luck!
Gustavo.

1 Like

When you build via Particle Workbench or CLI the project.properties dependencies are refering to specific library versions, so cloning a project will again pull in that specific version which cannot be altered after publishing anymore.

1 Like

Thanks for your replies guys. I figured the answer would be bundling the dependencies in the repo, for the reasons you both described.

Cheers,

Nolan

Actually, one last question, do you also checkin the target folder to source control, or .gitignore it?

I do not commit my target folder. Cheers!

1 Like

I do not commit the target or bin folders, or .vscode except for the json files.