Importing and Syncing a Theme from GitHub
GitHub Theme Sync
You can import a theme from a GitHub repository and keep it in sync with one branch. Cartly creates a new theme from the repository, and every push to that branch updates the theme. Sync runs one way, from GitHub to Cartly: Cartly never writes to your repository.
Requirements
- Any Cartly plan. GitHub theme sync is included on Starter, Growth, Pro and Enterprise.
- The store owner or an admin. Only they can import, re-sync or disconnect a GitHub theme.
- A GitHub account with access to the repository. Cartly asks for the
repopermission, so it can read private repositories and add the push webhook. GitHub lets only repository admins add webhooks, so automatic updates need admin access to the repository. - Theme folders at the root of the repository. Cartly reads
layout/(orlayouts/),templates/,sections/,snippets/,blocks/,assets/,config/andlocales/, and ignores everything else. The repository must containlayout/theme.liquid(orlayouts/theme.liquid).
Import always creates a new theme. A theme that is already in your library cannot be linked to a repository: to manage it in GitHub, put its files in a repository and import that repository.
Step 1: Connect Your GitHub Account
Go to Themes, click Add theme and choose Connect from GitHub. The first time, a GitHub window opens and asks you to authorize Cartly. After you authorize, the window tells you GitHub is connected and you can close it. The Themes page shows GitHub connected successfully.
Step 2: Choose a Repository and Branch
Click Add theme → Connect from GitHub again. The Import theme from GitHub dialog lists the repositories your GitHub account can access. Select a repository, then a branch, and click Import. If the branch is already connected to another theme, the dialog says so, and importing creates a separate copy.
Step 3: Initial Sync
Cartly creates a new, unpublished theme named after the repository and downloads its files. The theme card shows the repository and branch (owner/repo@branch) with a spinner while the sync runs. When it finishes, preview the theme and publish it when you are ready. Importing never replaces your live theme.
Automatic Updates
During the import, Cartly adds a push webhook to the repository. After that, every push to the connected branch updates the files that changed. Pushes to other branches are ignored. If the webhook could not be added, for example because your GitHub account is not a repository admin, pushes do not reach Cartly; use Re-sync instead.
Sync Status
The repository line on the theme card shows the state of the last sync:
- Green dot: the last sync completed.
- Spinner: a sync is queued or running.
- Red dot: the last sync failed. The error appears under the repository name; hover over it to read the whole message.
A completed sync can still list files it did not take: a path Cartly does not accept, or a file over the size limit (256 KB for Liquid files, 5 MB for other files).
Re-sync
Click Re-sync under the repository name to download the whole branch again. Use it after a failed sync or when pushes are not reaching Cartly.
Read-Only Files
While a theme is connected to GitHub, its files cannot be edited, renamed or deleted in the Cartly code editor. A banner in the editor shows the repository and branch. Make your changes in the repository and push them.
Disconnecting
Click Disconnect under the repository name on the Themes page, or Disconnect in the code editor banner, and confirm. The theme keeps its current files, stops syncing, and can be edited in Cartly again.
Troubleshooting
- Sync failed: missing required file layouts/theme.liquid: the theme folders must be at the root of the repository, not in a subfolder.
- Pushes do not update the theme: check that the webhook exists in the repository under Settings → Webhooks and that you pushed to the connected branch. Click Re-sync to catch up.
- The repository is not in the list: make sure your GitHub account can access it. For an organization repository, the organization may have to approve Cartly's access first.