Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm just getting into editing theme files locally using Git and Shopify CLI and I'm trying to nail down my workflow. Everything seems to be working fine with the exception of the fact that I can't seem to figure out how to get code from the 'main' branch in GitHub to deploy to the Current theme in Shopify when I merge 'staging' into 'main' in Github.
1. In the Theme Library in Shopify admin click 'Create Theme' and select 'Connect From GitHub'
2. Choose to connect to 'main' branch - creates a duplicate of the Current theme
3. from 'main' branch, git checkout -b features/FEATURE_NAME - Creates a feature branch and switches over to it
4. git push --set-upstream origin feature/FEATURE_NAME - pushes feature branch files up to GitHub
5. make edits locally
6. add, commit and push changes up to GitHub
7. In GitHub, create Pull Request for Feature Branch ---> 'staging' branch
8. merge PR from #7
9. In Theme Library, preview Staging theme (this was created the same way as #1 upon initial setup) and verify changes
9. In GitHub, create Pull Request for 'staging ---> 'main' branch
10. . . .
It is my understanding that there is a way for the code that is merged into 'main' in #9 to also be deployed to the Current Theme, but I can't figure out how to connect them. The only way I know of connecting a branch with a theme is to create a new theme and choose 'Connect from GitHub' .
Right now, I'm having to use shopify theme push after syncing all my local files with GitHub which works, but I'd much rather be deploying from the 'main' branch of the repository for obvious reasons.
What am I missing?
Solved! Go to the solution
This is an accepted solution.
I figured it out....
After #2, you must publish the newly created theme. This creates the link to the GitHub repository. It should be noted that #1 and #2 (and the extra step just mentioned) only need to be done during initial setup.
This is an accepted solution.
I figured it out....
After #2, you must publish the newly created theme. This creates the link to the GitHub repository. It should be noted that #1 and #2 (and the extra step just mentioned) only need to be done during initial setup.
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024