Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Which is the best repo method for common files?

Ben Butler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2024

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:

  • Make it is easy to deploy each version (without having to gather latest version of common files etc).
  • Keep track of committed changes in a meaningful way for common files and unique/independent files.
  • Reduce the amount of work managing multiple versions.

 

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

1 answer

0 votes
Brant Schroeder
Community Champion
December 3, 2025

@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.  

Ben Butler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 7, 2025

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.

Brant Schroeder
Community Champion
December 8, 2025

@Ben Butler Git has submodules.  I would suggest looking that up and seeing if that will meet your needs.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events