Hi everyone,
I have a JavaScript project that has multiple deployed versions that share some common files. I have had a look at submodules and subtrees etc and wondering what the best approach for my case is.
Eg. I have 3 different deployment versions: Red, Blue and Green. Each version contains an identical file structure, but some JS files are unique to each version and some are identical across all versions. So, I am keeping all 3 versions in a single Repo, but each time I edit one of the common files in one of them, I need to copy that updated file into the other 2 versions to replace the file in their identical location. I would prefer to just have one version of the common files, but not sure the best way to do this. I'm sure there are many ways and would like to hear what everyone thinks is the best - especially so I can:
Note: I am working on this alone, so no need to consider merge conflicts from multiple accounts etc. Also, I am using Sourcetree and prefer to be able to do everything in there without having to do any command execution.
Cheers,
Ben
@Ben Butler welcome to the Atlassian community
I would suggest putting all of the common shared files in their own repo and having a repo for the 3 different deployment versions. You can then add the common repo to each of the three repos as a submodule. This will allow you to manage each version independently.
Thanks Brant. That sounds like a good solution, but I was also hoping that there would be some sort of automated way to keep the common repo linked to the 3 deployment repos - so they could automatically update or download together each time I need to deploy to production with updates, rather than stitching them back together manually each time. I was wondering if Sourcetree or even just GIT have an inherent solution for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ben Butler Git has submodules. I would suggest looking that up and seeing if that will meet your needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.