Sale price
€0,00
Regular price
€1.000,00
Step 1: Set up required tools
Ensure the required tools are correctly set up:
- GitHub account
- GitHub Desktop
- Shopify CLI
- Shopify GitHub app (see instructions below)
- Visual Studio Code
Step 2: Download Shopify theme code
Get the theme files locally to set up with GitHub.
- Go to folder where you want to store your theme, e.g. /Users/<username>/GitHub
-
Shopify recommends the use the Skeleton theme for custom themes, which can be found at https://github.com/Shopify/skeleton-theme or by running:
shopify theme init
Name of the new theme:
shopify-theme
Include LLM instructions in the theme?
VS Code (GitHub Copilot)
Alternatively, if you want to adjust an existing theme:
- Log in to your Shopify admin at https://admin.shopify.com/ (or your store's URL).
- Go to Online Store > Themes.
- Locate your theme, click the ... (actions) menu, and select Download theme file.
- Shopify emails you a ZIP file—download it.
- Unzip to a new folder.
This folder has your theme files (e.g., layout/theme.liquid).
Step 3: Set up Git repository using GitHub Desktop
Use GitHub Desktop for an easier workflow than command line.
- Open GitHub Desktop.
- Click File > New Repository (or the "+" button).
- In the dialog:
- Name: e.g., "shopify-theme-repo".
- Local path: Choose your unzipped theme folder.
- Git ignore: Select "None" or "Liquid" if available (optional).
- License: None.
- Click Create Repository. This initializes Git in your folder.
- Move all theme folders and files into the newly created Git repository.
- In GitHub Desktop, you'll see all files listed as changes. Enter a commit message like "Initial commit of Shopify theme" in the bottom left, then click Commit to main.
- To push to GitHub: Click Publish repository (top right). Confirm the repo name, keep it public or private, and publish.
- This creates the repo on GitHub and uploads your files.
- Verify on github.com—your repo should show the theme files.
Step 4: Install and connect the Shopify GitHub app
This links Shopify to your GitHub repo for automatic syncing.
- Install the Shopify GitHub app.
For more information, check out: https://shopify.dev/docs/api/github-app - In Shopify admin, go to Online Store > Themes.
- In Theme library, click Add theme > Connect from GitHub.
Add theme can also be called Import theme. - Authenticate with GitHub if prompted—log in and grant access to your repo.
- In the Connect theme panel:
- Select your GitHub account.
- Repository: Choose "shopify-theme-repo".
- Branch: "main".
- Click Connect. A new theme appears in your library, linked to GitHub.
- If replacing your current theme, click Publish on the new one (your old theme unpublishes automatically). Remove the old one if unnecessary.
Edits in Shopify now auto-commit to GitHub, and pushes from GitHub update Shopify.
Step 5: Set up Visual Studio Code for editing
Integrate VS Code with your local repo.
- Open VS Code from Applications.
- Install extensions:
- Click the Extensions icon (squares) on the left.
- Search and install:
- "Shopify Liquid" by Shopify (for .liquid file support).
- "Prettier - Code formatter" (for auto-formatting).
- "GitHub Pull Requests and Issues" by GitHub (for GitHub integration in VS Code—optional but useful).
- Reload VS Code if asked.
- Open your theme folder: File > Open Folder, select ~/Documents/my-shopify-theme.
- VS Code detects the Git repo—see the branch (main) in the bottom left status bar.
- For GitHub Desktop integration: You can edit in VS Code, then switch to GitHub Desktop to commit/push, or use VS Code's built-in Git (Source Control sidebar) if preferred.
Step 6: Workflow for editing and syncing
A simple routine to make changes safely.
- Pull Updates: In GitHub Desktop, open your repo and click Fetch origin (or Pull if changes exist) to sync from GitHub/Shopify.
- Edit Files: In VS Code, modify files (e.g., add code to theme.liquid). Save changes (Cmd + S).
-
Commit and Push:
- Switch to GitHub Desktop—it shows your changes.
- Select files, add a message (e.g., "Updated navigation"), and commit.
- Click Push origin to upload to GitHub.
- Check in Shopify: Refresh admin > Themes. Changes should appear; preview before going live.
- Resolve Conflicts: If simultaneous edits cause issues, use GitHub Desktop's merge tools or Shopify's "Reset to last commit" on the theme card.
- Testing: Use Shopify's theme preview to test edits. For collaboration, invite others via GitHub.