Developing with Shopify CLI and Online Store 2.0 (with GitHub) Workflow
A couple months ago, I was working on a Shopify Theme and accidentally deleted the whole CSS file. Luckily for me there was a backup theme I was able to copy the CSS from but any changes or updates I made to the file was gone. This led to a painful afternoon of figuring out what CSS changes I made and a whole lot of time lost on this project. But what if I didn’t have that backup file? Then that’s tens of thousands of lines of CSS I’ve lost. This is why we as developers use Git.
Git is one of the most important tools for a developer’s workflow. Git helps us keep track of changes done to a file so we have records on what work has been done. In a world where I was using Git, I would’ve simply been able to recover that deleted file and save myself a whole afternoon of time and pain.
The new Shopify Online Store 2.0 updates introduced a simple GitHub integration with your Shopify Theme. Shopify has even widened the scope of the Shopify CLI to include themes.
I will be showing you how you can integrate GitHub into your Shopify theme development workflow using the new Github integration with Shopify Themes and the updated Shopify CLI.
Lets dive in:
1. Shopify Partners Account and Development Store
If you already have a Shopify Partners account and development store you can skip to step 2.
Head over to Shopify Partners and create a Partners Account.
Then click on Stores on the top left then Add store on the top right. Choose Development store as your store type and fill out the other information required and click Save. You’ll then be redirected to your new store.
2. Shopify CLI Installation
You can head over to the Shopify CLI Installation page here and install the CLI based on your platform/preferred method.
Since I’m on a Mac, I’ll use Homebrew and run the follow commands in the terminal
$ brew tap shopify/shopify
$ brew install…