1. Prerequisites:
-
Shopify Cli:
- Installation Guide : (https://shopify.dev/themes/tools/cli/installation)
- Gettings started : (https://shopify.dev/themes/tools/cli/getting-started)
- Core Commands: (https://shopify.dev/themes/tools/cli/core-commands)
- Theme Commands (Optional) : (https://shopify.dev/themes/tools/cli/theme-commands)
-
Collaborator Access: (https://shopify.dev/themes/tools/collaborator-accounts)
2. Git + Shopify Setup:
- Create an empty git repository.
- Clone the same repository on your local machine.
- Setup the Shopify store with a theme of your choice.
- Connect to store from terminal using Shopify CLI from your local git repository with the command:
shopify login --store example.myshopify.com - Pull theme from your store using the command:
shopify theme pull - Push the same code to the GitHub base branch: master
- Clone same repository with name staging and push to the same repository.
- Go to your development store => themes => Them Librabry => Add theme
- Select -> Connect to Github Account
- Select your repository and base branch name master. Publish your master theme and rename the theme id to
Store name | Live - Again follow steps 8 and 9 and now select branch staging and rename that theme id to
Store name | Staging
**Note: This theme id will remain unpublished.
3. Starting Local Development Server + GIT (Pull Request and merge):
- Local Setup
- Always clone branch from staging branch
shopify login --store example.myshopify.com - Connect to store using command
shopify theme serve - Start local development server using command
- You will get the link for both theme editor and link for development theme.
- If you make any changes in the theme editor and you want to merge those changes as well use the command shopify theme pull and select your local theme id.
- Always clone branch from staging branch
- GIT (Pull Request and merge):
- Always make Make PR for staging branch so that your changes will be synced with theme id to
“Store name | Staging ” - To make final changes live, staging branch should be merged to base branch which is master so that all the changes are synced with
“Store name | Live ”
**Note: Only after development is done.
- Always make Make PR for staging branch so that your changes will be synced with theme id to
- For QA
- In development store always duplicate
“Store name | Staging ”and rename it to“Store name | QA ” - Once QA is done delete the theme id and follow step 1 for newer QA tests.
- In development store always duplicate