Looking for a great way to use GIT on multiple identical Shopify stores

Viewed 46

As the title says, I'm looking for a great way to use GIT on my client's stores, that are identical. When I say identical, I'm meaning that they're basically the same store, only the language of the store, as well as the currency, is different.

I've been thinking of ignoring the file settings_schema.json, but I'm not 100% sure if that's a good idea.

My main goal is, if the client wants a new feature, build in the theme, I need a great way to push that new feature automatically to the rest of the stores.

Let me know if this question falls outside of StackOverflow.

1 Answers

You have two options:

Option 1: without ignoring config\settings_schema.json & config\settings_data.json

if the different stores for different countries for example: country-1 & country-2 & country-3

you will have a master branch which will be initially exactly the same as the country-1 store code, then you will have 3 other branches for the other 3 countries:
country-1 git branch for country-1 store code
country-2 git branch for country-2 store code
country-3 git branch for country-3 store code

when you need to make a new modification that will be applied to all stores, then you will commit it to the master branch, then merge the modifications to all country-1 & country-2 & country-3 branches

if you need to apply a country-specific modification to country-1 only then you will commit it to country-1 git branch only and not on other branches.

the country-specific modifications will be anything different between the stores including any change on config\settings_schema.json & config\settings_data.json


Option 2: with ignoring config\settings_schema.json & config\settings_data.json

the same as option 1 but with:

Adding a new setting for store_country inside config\settings_schema.json to determine which country you are on

{
"type": "text",
"id": "store_country",
"label": "store country name"
}

and on each store, you will add the store_country so on config\settings_data.json:
on store-1: it will be "store_country": "country-1",
on store-2: it will be "store_country": "country-2",
on store-3: it will be "store_country": "country-3",

then on any page for example some-section.liquid you can use if condition to determine which store you are on

{% if settings.store_country == 'country-1' %}
   country-1 content...
{% elsif  settings.store_country == 'country-2' %}
   country-2 content...
{% elsif  settings.store_country == 'country-3' %}
   country-3 content...
{% endif %}
Related