2

I'm new to Shopify Themes Development. I downloaded the free Shopify theme template using Themekit. I want to push the theme to Github but in VS Code it's showing that there are 156 files to be pushed on Github.

Folder names are: assets, config, layout, locals, sections, snippets, templates

File name: config.yml

That's obvious, this is not a way.

Can someone please tell me what files and folders i need to write in .gitignore So that those won't be pushed on Github.

Thanks in Advance!

2
  • other than files that come from plug-in (app), assets like images,. everything is important. Commented Mar 6, 2021 at 0:07
  • 1
    I added config.yml file in .gitignore and pushed the remaining part. Commented Mar 7, 2021 at 22:58

2 Answers 2

3

Shopify has an example .gitignore in their starter theme. I'm not sure why they don't include settings_data.json but I would definitely include it. Here's what I'd use:

# Shopify #
###################
config.yml
config/settings_data.json

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Sign up to request clarification or add additional context in comments.

2 Comments

You should NOT include config/settings_data.json in .gitignore. The file is vital to the theme and it is how you can track changes made in the theme customization. If you clone a Git repo with a Shopify theme that doesn't have this file, you cannot upload it on Shopify.
tbh I would only NOT ignore config/settings_data.json if you have your theme connected to Github and the latest changes made by others (such as your client) are then committed into the repo. The reason everyone ignores config/settings_data.json is that if you push an out of date one you nuke everyones recent theme updates.
2

ThemeKit will only care about file inside assets, config, layout, locals, sections, snippets, templates folders, anything else will be ignored thus, not uploaded to shopify.

It is a good practice tho, ignore: config/settings_data.json you only want that to be updated in the theme customiser.

2 Comments

This has changed with Online Store 2.0 as the configuration can now also appear in JSON-based template files. (Idiotic move, if you ask me. These files can't be ignored because they also contain the sections and blocks.)
I should add here, that all files of the theme are vital. You shouldn't ignore anything. Think about whether you will be able to make a fresh clone of the theme's Git repo (without any ignored files) and upload it to Shopify as a new theme. If it fails, then you're excluding something that shouldn't be excluded.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.