Shopify GitHub integration: a step-by-step guide

Shopify theme code with the GitHub logo, for a guide to the Shopify GitHub integration

The Shopify GitHub integration connects a branch in a GitHub repository to a theme in your store, and keeps the two in sync both ways. You set it up in your admin under Online Store > Themes > Add theme > Connect from GitHub, after installing the Shopify GitHub app.

Once it's connected, every commit to the branch updates the theme, and every save in the theme editor or code editor becomes a commit on the branch. That gives you a full history of your theme, safer updates and a clean way for several developers to work on one store.

Shopify theme code with the GitHub logo

What the Shopify GitHub integration does

GitHub is a hosting service for Git repositories, where developers store code, track every change and review each other's work. Shopify's GitHub integration (sometimes searched as "Shopify Git integration") links that history to your live store:

  • GitHub to Shopify. Commits pushed to the connected branch update the theme in your theme library.
  • Shopify to GitHub. Saves in the theme editor, the code editor and theme app settings are committed to the branch by the shopify bot. The commit message names the store and the staff member who last edited. Edits saved within about 10 seconds of each other are grouped into one commit.
  • Always on. You can't turn off syncing to GitHub. If there's code you don't want Shopify to see, keep it in a separate repository.

Why use GitHub with your Shopify theme

  • Full history. Every change, whether from a developer or from someone dragging sections around in the theme editor, is recorded with who made it and when.
  • Easy rollbacks. If an edit breaks a page, you can revert the commit instead of trying to remember what changed.
  • Safer theme updates. When your theme vendor releases a new version, a developer can merge it with your customizations in Git, with conflicts shown line by line. See our guide to updating your Shopify theme without losing anything.
  • Teamwork and code review. Developers work on their own branches and open pull requests, so changes get reviewed before they reach the live theme.
  • An off-site copy of your theme. Git isn't a full store backup (it doesn't include products, orders or customers), but it's a reliable copy of your theme code. For the rest, see how to back up your Shopify store.

Before you start

Check these first, because they cause most failed setups:

  • Shopify permissions. You can connect as the store owner, a staff member or a collaborator with the Themes permission.
  • GitHub permissions. You need write access to the repository. GitHub "outside collaborators" can't connect branches; only organization members with write access can. Personal repositories where you're a collaborator but not the owner won't appear in the list.
  • One GitHub account per Shopify account. Shopify recommends a GitHub organization rather than a personal account, so access is easier to manage.
  • Theme folder structure. The branch must use Shopify's default theme folder structure (assets, config, layout, locales, sections, snippets, templates and so on). Other folders are ignored. If your theme has a build step, connect a branch that holds the built output.
  • Theme library space. Each connected branch becomes a theme in your library. Stores on Basic, Grow and Advanced can hold up to 20 themes, so remove unused ones first if you're near the limit.
  • New development or client transfer stores. You can't set up the GitHub app on your first login to a new store. Log out and log back in first.

How to set up the Shopify GitHub integration

Step 1: Put your theme in a GitHub repository

If your theme isn't in GitHub yet, a developer can pull it down with Shopify CLI and push it to a new repository:

  1. In GitHub, create a new repository (private is usual for client themes).
  2. On your computer, run shopify theme pull --store your-store.myshopify.com and pick the theme to download.
  3. In that folder, run git init, commit the files and push them to the repository's main branch.

You can also download a theme from Online Store > Themes, click ... next to the theme and choose Download theme file. Shopify emails you a ZIP. See our Shopify theme export guide.

Step 2: Install the Shopify GitHub app

  1. Install the Shopify GitHub app from its page on GitHub (github.com/apps/shopify).
  2. Choose your organization (or personal account).
  3. Grant access to only the repositories you want to connect. Shopify recommends per-repository access: anyone in your store with the Themes permission can see every repository the app can reach.

If you create a new repository later, you have to grant the app access to it in GitHub before it shows up in Shopify.

Step 3: Connect a branch to a theme

  1. In your Shopify admin, go to Online Store > Themes.
  2. In the Theme library section, click Add theme > Connect from GitHub.
  3. Log in to GitHub if asked.
  4. In the Connect theme pane, select your organization or account.
  5. Under Repository, select the repository.
  6. Under Branch, search for and select the branch.

The branch's files are added to your theme library as a new theme. The theme card shows the repository, the branch name and the time of the last commit.

Step 4: Test the connection

  1. On the connected theme, click Customize.
  2. Change a small setting, for example the announcement bar text, then click Save and exit the editor.
  3. On the theme card, click the branch name to open it in GitHub.
  4. Check the latest commit. It should come from the shopify bot and name your store and the person who saved.

You can also test the other direction: push a small commit from your computer and check that the theme's Last saved time updates.

Step 5: Publish a connected theme

To track your live store in Git, publish a theme that's connected to a branch. A theme that was connected while unpublished keeps its branch connection after you publish it. Shopify's suggestion is to connect your main branch and publish that theme, so merged features go live automatically.

Branch strategy that works for most stores

Shopify's version control guidance comes down to a few rules:

  • main = live theme. Connect main and publish it. Anything merged into main goes live.
  • Feature branches for development. Developers branch off main, work locally with Shopify CLI and open a pull request. Merge only after review.
  • Campaign branches for sales and launches. Connect a separate branch (for example black-friday) as its own theme, publish it for the campaign, then republish the main theme.
  • A deploy branch if you have a build step. Keep source code on one branch and compile into a separate branch that matches Shopify's folder structure. Connect the deploy branch, not the source.

One rule that catches teams out: pull before you push. Merchants and marketers keep editing in the theme editor, and those saves change JSON files like config/settings_data.json and templates/*.json on the connected branch. If a developer works from an old copy and force-pushes, those edits are overwritten.

Shopify GitHub integration vs Shopify CLI

They do different jobs, and most teams use both.

Shopify GitHub integration Shopify CLI
What it is
A connection between a GitHub branch and a theme in your library
Shopify's command-line tool for themes and apps
Where it runs
Shopify and GitHub, no local setup
A developer's computer or a CI pipeline
Direction
Two-way, automatic
One action at a time (pull, push, dev)
Best for
Keeping the live theme and Git history in sync, including theme editor changes
Local development, live previews, pushing to unconnected themes, scripted deploys
Key commands or steps
Add theme > Connect from GitHub
shopify theme dev, shopify theme pull, shopify theme push, shopify theme check

A typical workflow:

  1. A developer creates a feature branch and runs shopify theme dev to work against a private development theme with hot reload.
  2. They run shopify theme check to catch Liquid errors before committing.
  3. They open a pull request; someone reviews it.
  4. After merging into main, the GitHub integration updates the connected live theme. No manual upload.

If you don't use the GitHub integration, Shopify CLI can deploy from a CI pipeline instead (for example, shopify theme push in a GitHub Actions workflow). That route doesn't commit theme editor changes back to Git, so you'd need to pull them yourself. For a refresher on the language inside those files, see what Shopify's Liquid is.

Fixing sync problems and conflicts

  • Someone saved in the theme editor while a developer changed the same file. The theme editor warns the user that saving will overwrite newer changes. The code editor gives no warning, and its version overwrites the GitHub version.
  • Conflicts from commits made outside Shopify have to be resolved in GitHub, or by force-pushing to overwrite the file in Shopify.
  • A save and a push happen at the same moment. GitHub may reject Shopify's commit as outdated.
  • Checking what happened. On the connected theme, click View logs next to the Last saved time.
  • Resyncing. On the theme, use Actions > Reset to last commit to match the theme to the branch.
  • A repository doesn't show up. The GitHub organization owner needs to give the Shopify GitHub app access to that repository.
  • Your organization turned on SAML single sign-on after you installed the app. Re-authorize the Shopify GitHub app, and make sure you have an active SAML session.
  • Disconnecting. A branch you disconnect can't be reattached to the same theme. Connecting it again adds a new theme.

To remove the integration entirely, open your GitHub settings for authorized apps and click Revoke next to Shopify.

What to do next

  1. Make sure your current theme is backed up or exported before you connect anything.
  2. Set up a GitHub organization and install the Shopify GitHub app on just the theme repository.
  3. Connect a duplicate of your live theme first, test the two-way sync, then switch over to a connected main theme.
  4. Agree on the "pull before you push" rule with everyone who edits code.

If you'd rather not set this up yourself, including moving your current customizations into the repository, you can hire a vetted Shopify expert to do it. For day-to-day theme edits without Git, see how to edit your Shopify theme.

Frequently asked questions

Does Shopify integrate with GitHub?
Yes. Shopify's GitHub integration connects a branch in a GitHub repository to a theme in your store. You set it up in Online Store > Themes > Add theme > Connect from GitHub after installing the Shopify GitHub app.
Does the Shopify GitHub integration sync both ways?
Yes. Commits pushed to the connected branch update the theme, and saves in the theme editor or code editor are committed back to the branch by the shopify bot. You can't turn off the sync to GitHub.
Can I connect a theme with a build step (src and dist folders) to GitHub?
Not directly. The connected branch must match Shopify's default theme folder structure. Build your code into a separate deploy branch and connect that branch instead.
Should I use the GitHub integration or Shopify CLI?
Most teams use both. The GitHub integration keeps a live theme and its Git branch in sync, while Shopify CLI is for local development, previews and pushing to themes that aren't connected to GitHub.
Can I connect more than one GitHub account to Shopify?
No. Your Shopify account can connect to one GitHub account. Shopify recommends using a GitHub organization so you can manage access for a team.