With the Online Store 2.0 stuff, are you guys using the whole git subtree method mentioned in the shopify/git docs (https://shopify.dev/themes/best-practices/version-control) ? I’ve been putting src/ folder in my theme and it’s working fine, but they don’t mention that as a viable option in the docs.
Topic summary
Use of git subtree for Online Store 2.0 themes is debated; several participants report success keeping a src/ folder in the theme and building directly into assets, despite Shopify docs not listing this option.
Key points:
- Keeping assets under version control is necessary for deployment. This often implies running build commands locally, as direct GitHub Action integration with the main repo isn’t straightforward.
- A src/ directory is ignored by Shopify’s theme structure, which can work, but splitting production code via subtree remains confusing for some.
Reported issue:
- Having a directory like assets/Build triggers a Shopify CLI error (Errno::EISDIR) during Lighthouse CI, indicating directories inside assets can break syncing. The error log is central to understanding this problem.
Suggested workflow (no subtree):
- Maintain standard theme structure; compile SCSS/JS (via webpack or gulp) and output bundled files directly into assets.
- Use .shopifyignore to exclude non-theme files and avoid dist/ folders.
- Run shopify theme serve alongside the build tool; when pulling, use shopify theme pull --nodelete to prevent unintended deletions.
Status:
- No final consensus on subtree. A practical, assets-focused workflow is favored; key questions on CI/GitHub integration remain open.
I’ve just tested this approach and it does work. I think the reason they don’t list it as a viable option is because you can’t plug a Github action directly to the main repo, and you have to keep the contents of the assets folder under version control for them to be deployed. For the former that means you need to run your build commands locally. As for the latter, having assets part of the repo would be a requirement anyway, so it appears to be a viable workflow to me too.
Have either of you managed to go down the subtree route yet? I too have a src folder in my root and everything seems to be working ( anything outside of Shopify’s theme structure is ignored ). I can’t seem to get my head around splitting the production code out.
The problem is that if you have assets/Build folder inside your project, you will get this error while executing a lightouse action in github:
Configuring shopify CLI
Will run Lighthouse CI on https://***
==============================
Creating development theme
This command ran with ID: 50863
Please include this information in any issues/report along with relevant logs
/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read': Is a directory @ io_fread - assets/Build (Errno::EISDIR)
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:20:in `read'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/file.rb:57:in `checksum'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:291:in `file_has_changed?'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:193:in `enqueue'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `block in enqueue_updates'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `each'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:42:in `enqueue_updates'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/theme/syncer.rb:152:in `upload_theme!'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/project_types/theme/commands/push.rb:55:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/sub_command.rb:13:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/command.rb:19:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:16:in `block (2 levels) in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:15:in `block in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:14:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/executor.rb:15:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:24:in `block in call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/monorail.rb:20:in `log'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:23:in `call'
from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/shopify-cli-2.0.1/bin/shopify:33:in `block in
I can’t see a reason to use subtree at all. Just maintain the current theme folder structure and have your build process put files into assets.
I have just finished setting up webpack to compile scss, and translate/compile js as well. The output files go into the assets folder and all is well! My npm run dev command uses ‘concurrently’ to run webpack along side ‘shopify theme serve’.
Hello Sandy,
In your approach how do you ensure that you have everything under version control while also being able to make use of the Shopify Github Integration?
I am currently trying to set up the Shopify Github Integration with my theme project that uses gulp to compile sass and es6 javascript into the asset folder of my theme.
I’ve sent everything that I want to use for production into a dist/ folder and was trying to use a subtree to store the dist, but was having issues.
Hi pierrewebdev
The way i do it isn’t in the Shopify Docs… but works well for us. You
need to set out the project so that shopify can pull down all the
directories it wants… all other directories and files in the repo
will be ignored. So don’t use a dist folder… just have your bundled
files go into assets. One thing you have to watch out for is to use a
.shopifyignore file listing everything that’s not a theme file, and do
not use the shopify theme pull command without the --nodelete flag.
Actually… i recommend committing your changes and then doing that
command… then you will see how shopify pulls files from the repo.
Hope that all makes sense!