Shopify Theme Development with Git

In the early days of Shopify theme development, the online code editor provided by Shopify Admin was used for simple business needs, but this is not suitable for changing the entire theme.

What's exciting, however, is that in June 2021, Shopify launched the latest Github integration, making theme development and app development more efficient! And combined with the software testing and release process of the technology company itself.

Better development workflow

Install shopify cli's command line tool, which can quickly generate a Node.js development environment, make changes locally and sync those changes with the shopify website

brew tap shopify/shopify
brew install shopify-cli# init project a new theme
shopify theme init# or can init Existing git repository
shopify theme init [NAME] --clone-url=https://github.com/shopify/dawn.git# Authenticating with Shopify CLI
shopify login --store shoptestex.myshopify.com

Preview the developed theme in the local environment

Open the link http://127.0.0.1:9292 to watch the programs developed in the local environment, and also supports hot reloading

shopify theme serve

Install the Shopify GitHub integration

  1. Create a new repository on github and submit the developed theme to it
  2. From the shopify admin, go to Webshop → Themes
  3. In Set theme libraryAdd set theme from github link
  4. Log in to github and select the repository to connect to
  5. Find the connected topic and click Action → Post

Shopify Version Control Best Practices

When editing a theme through the shopify backend, any changes will be automatically submitted to github by shopify, so developers may encounter conflicts and errors when submitting to github.

So you should build a staging branch. When multiple developers develop features on the same store, they only deal with the staging branch. When the theme is ready to go live, then merge the staging branch into the master branch.

Install the Visual Studio Code plugin

theme check can check the liquid and json in the theme, which allows us to quickly detect errors during development

https://marketplace.visualstudio.com/items?itemName=Shopify.theme-check-vscode

The above is a method that can deliver products more stably in terms of technical development. If you have any questions, please feel free to communicate with us.

推薦閱讀

Figma的Dev Mode:開發者的全新聖地
Figma的Dev Mode:開發者的全新聖地
引言 對於網站和應用開發者來說,將設計快速且準確地轉換為程式碼一直是一個挑戰。Figma 最近推出了一個名為“Dev Mode”的全新功能區,這個功能專為開發者設計,能夠有效地幫助你將設計快速轉為程式碼。本文將深入解析 Dev Mod...
繼續閱讀
如何將 Shopify 資料從 通用(Universal) GA 轉移到 GA4
如何將 Shopify 資料從 通用(Universal) GA 轉移到 GA4
Google 將於 2023 年 7 月終止通用分析的支援,取而代之的是 Google 分析 4(GA4),這是 Google 的新一代效能評估解決方案。通用分析將繼續收集資料直到 2023 年 7 月終止為止,您在未來至少 6 個月...
繼續閱讀
Selly:提升您的Shopify商店銷售和客戶滿意度的強大應用程序
Selly:提升您的Shopify商店銷售和客戶滿意度的強大應用程序
在這篇部落格文章中,我們將探討一個非常受歡迎的Shopify應用程序 - Selly。這款應用程序為您的電子商務商店提供了一個強大的功能集,以提高銷售額和客戶滿意度。讓我們一起來了解Selly如何幫助您的Shopify商店實現更好的成...
繼續閱讀

leave a message

Please note that comments must be reviewed before they are published