The first three parts gave you ways to change a theme. This one gives you a memory: every change recorded, every version recoverable, and a clear answer to "who changed this and when". With Shopify's GitHub integration, a branch in a repository becomes a theme in your store.
Prepare the repository
The integration only connects branches that follow the standard theme folder structure from part 2: layout/, templates/, sections/ and the rest at the root. If you use a build step, connect a branch that holds the built files, not the source. The quickest way to get there is to pull the live theme with Shopify CLI (part 3), commit it and push it to a new repository.
Connect a branch
- Install the Shopify GitHub app on your GitHub account or organisation. Granting it access to specific repositories keeps the list tidy for staff.
- In the Shopify admin, go to Online Store and then Themes.
- In the Theme library, click Add theme and then Connect from GitHub.
- Pick the account or organisation, the repository and the branch.
The theme card now shows the repository, the branch and the time of the last commit. You need write access to the repository; GitHub outside collaborators cannot connect branches.
How the two-way sync works
- GitHub to Shopify: every push to the branch updates the connected theme.
- Shopify to GitHub: every save in the theme editor, the code editor or a theme app becomes a commit on the branch, authored by the
shopifybot and naming the person who saved. Saves within about ten seconds of each other are combined into one commit.
The write-back cannot be switched off, and that is a feature. The merchant's editor changes from part 1 now land in Git like everyone else's, so the overwrite problem from part 3 becomes an ordinary merge you can see and resolve.
A branch setup that works
Shopify's own recommendation is simple, and it is close to what I use:
- main is connected to the published theme. Merging into main is how the live store changes, and nothing else changes it.
- Feature branches are connected as unpublished themes, so each piece of work has its own preview in the real store.
- Campaign branches can be published temporarily, for a sale for example, and the main theme is republished afterwards. Publishing a connected theme keeps its connection.
On EV Zug I worked exactly this way: separate development and production themes on a branch-based workflow, with matching environments for the store's app. It is what makes it possible to ship in small, reviewable steps while the club's shop stays open.
Three habits that save trouble
- Pull before you merge. The branch receives the merchant's commits from Shopify, so update your local copy first and merge their changes into yours, not the other way round.
- Keep content decisions with the merchant. When
templates/*.jsonorconfig/settings_data.jsonconflict, the merchant's version is usually the right one. - Never reconnect a branch you disconnected. You cannot: connecting it again adds a brand-new theme. Disconnect only when you mean it.
Putting the four parts together
The theme editor for content, the code editor for a quick fix, Shopify CLI for real development, and GitHub so that all of it is recorded. If you would like this set up on your store, or a theme built on top of it, get in touch.