how to structure a git repository for a product

Good afternoon!
I could give a suggestion for how to structure a git repository for a product that the company has sold to several customers?
It is a single product, but customers will have different requirements and codes change sources. Currently there are several repository, one for each client, but is the same product. So the idea is to create a master repository of the product and when each client versions are released, the bugs fixed in a client, and others have corrected.
Thanks in advance for your attention.

2 answers

1 accepted

0 votes
Accepted answer

Good morning Romel,

This is one of those questions that doesn't have one right answer, but I can give you my thoughts.

Depending on how you are customising the product for each customer you could extract out the common/core parts into a library, which is kept in one repository, and then depend on that library from each customer repository through some form of dependency management (ie Ruby Gems, Maven, Python Eggs, etc).

Otherwise you could just keep all the source in a single repository, and have "overrides" in customer specific folders. Because the files are in a single repository it will be tricky to make a change to the core product for one customer that doesn't affect another. The advantage of having a core library, mentioned above, is that you can "upgrade" a customer to a specific version of the product, whereas with a single repository there is only really one version/branch of everything. This may be what you want, I couldn't say.

Worst case scenario is to have a single repository with one branch for each customer. The problem here is that you constantly have to keep merging between branches and conflicts may arise. The advantage over your current approach is that you at least get conflicts if you change the same thing; I imagine at the moment you're having to manually copy files between each customer and it's hard to keep track of everything?

I hope that helps?


Right. I will study further to find a more optimal solution.

Thanks for the suggestions.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

660 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you