social-open-icon
social-close-icon
Facebook Instagram Linkedin twitter Youtube teams

Shopify CLI + GitHub Setup Guide for Beginners

The development process starts with writing and updating your theme code locally using Shopify CLI, which allows you to work safely without affecting the live store. Once your changes are ready, you save and track them using Git by creating a commit. This committed code is then pushed to GitHub, where it is securely stored and can be shared with your team. After that, the updated theme is pushed to your Shopify store, where it can be previewed or published. Finally, once everything is tested and approved, the changes go live on the store for customers to see.

If you want to speed up this entire workflow, you can always hire shopify developers who already follow best practices and efficient deployment strategies.

1. What You Are Setting Up (Important Understanding)

Before you begin, it’s important to clearly understand how each tool fits into your workflow and why it is used.

Shopify CLI
Used to develop and manage your Shopify theme directly from your local computer. It allows you to preview changes in real time, edit files, and sync your work with the Shopify store without touching the live site.

Git
Acts as a version control system that tracks every change you make in your code. It helps you manage history, revert mistakes, and work safely on different features without affecting the main project.

GitHub
A cloud-based platform where your code is stored online. It enables backup, collaboration with team members, and structured workflows like pull requests and code reviews.

Shopify Store
This is your actual eCommerce website where the theme is applied. All the changes you develop locally are eventually pushed here to be tested and published for users. If you’re scaling your store, it’s always smart to work with a professional shopify Agency to ensure performance and conversions.

2. Install Required Tools

Before starting Shopify development, you need some essential tools installed on your system.

Install Node.js
  • Node.js is required to run Shopify CLI and manage packages.
  • It also installs npm (Node Package Manager) automatically.

Download from: https://nodejs.org/
Verify installation: node -v

Install Git
  • Git helps you track changes in your code.
  • It allows collaboration and version history.

Download from: https://git-scm.com/
Verify installation: git –version

Install Shopify CLI
  • Shopify CLI is the main tool to develop, preview, and manage themes.
  • It connects your local system with your Shopify store.

Install using npm: npm install -g @shopify/cli @shopify/theme

Check: shopify version

3. Login to Shopify Store

Before working on a store, you must authenticate.

shopify login –store=your-store.myshopify.com

Example:

shopify login –store=abc-store.myshopify.com

  • Opens browser automatically
  • You log in once
  • CLI gets access to your store

This step securely connects your local environment to Shopify

Get Theme Code (2 Ways)

Option A: Pull Existing Theme (Recommended)

shopify theme pull

What happens:

  • Downloads current theme
  • Creates local project folder
Option B: Create New Theme

shopify theme init my-theme

cd my-theme

This creates a fresh theme

5. Project Structure (Very Important)

After pulling, you’ll see:

my-theme/

├── assets/ → CSS, JS, images

├── config/ → Theme settings (customizer data)

├── layout/ → Main layout file (theme.liquid)

├── sections/ → Reusable dynamic sections (homepage, product blocks)

├── snippets/ → Small reusable components (header, card, icons)

├── templates/ → Page templates (product, collection, cart)

This is your Shopify theme structure

6. Setup Git (Version Control)

Step 1: Initialize Git

git init

This starts tracking your project

Step 2: First Commit

git add .

git commit -m “Initial Shopify theme setup”

7. Connect to GitHub

Step 1: Create Repo on GitHub

Go to GitHub → New Repository

Example:

shopify-theme-store

Step 2: Connect Local to GitHub

git remote add origin https://github.com/your-username/shopify-theme-store.git

Step 3: Push Code

git branch -M main

git push -u origin main

Now your code is stored on GitHub ✅

8. Start Development (Most Important Step)

shopify theme dev

What this command does:
  • Creates a preview link
  • Watches file changes
  • Auto reload browser
  • Syncs with Shopify
Example Flow:
  1. Run shopify theme dev
  2. Open preview link
  3. Edit code (like product.liquid)
  4. Save file
  5. Page auto updates 🎉

9. Daily Workflow (Real Developer Flow)

Step 1: Pull Latest Code

git pull origin main

Step 2: Start Dev Server

shopify theme dev

Step 3: Make Changes

Example:

  • Update UI
  • Fix bugs
  • Add sections
Step 4: Save to GitHub

git add .

git commit -m “Updated product page UI”

git push

Step 5: Push to Shopify

shopify theme push

10. Branching (Team Work / Safe Work)

Create new branch

git checkout -b feature-header-update

Work and push

git add .

git commit -m “Header updated”

git push origin feature-header-update

Then:
  • Go to GitHub
  • Create Pull Request
  • Merge to main

11. Important Shopify Commands

🔸 Start Development: shopify theme dev
🔸 Pull Theme: shopify theme pull
🔸 Push Theme: shopify theme push
🔸 List Themes: shopify theme list

12. Deployment Strategy (Best Practice)

Never work directly on live theme

Use:

  • Development Theme
  • Staging Theme
  • Live Theme
Flow:

Local Dev → GitHub → Staging Theme → Live Theme

13. Pro Tips (Very Useful)

  • Always write clear commit messages
  • Never push broken code
  • Use branches for features
  • Pull before starting work
  • Backup via GitHub 

Conclusion

Whether you’re just starting or scaling a complex store, having the right workflow is crucial. If you want expert-level execution, you can hire shopify developers or partner with a trusted shopify Agency to streamline your development and deployment process.

Ready to build or scale your store? Contact us today!

Let’s Connect for Your Next Web Development Project.

Plan your next web or mobile application solution with us. Let us know your requirements and our team will get in touch with you.