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.
    – Charles C.
    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
2
  • 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.
    – ADTC
    Commented Feb 21, 2022 at 9:37
  • 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.
    – koosa
    Commented Jul 19, 2022 at 3:17
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
  • 2
    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.)
    – ADTC
    Commented Oct 11, 2021 at 3:17
  • 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.
    – ADTC
    Commented Feb 21, 2022 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.