Best practices for source control, libraries and dependencies

Tags: #<Tag:0x00007fe21fd67e10>



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?



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.


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!


When you build via Particle Workbench or CLI the 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.


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




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!


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