Github Integration: "Branch isn’t a valid theme"

Rockethouse
Tourist
3 0 1

Getting this error for a theme that I know is perfectly valid because I can upload it just fine as a zip or using the old theme-kit cli tool.

I'm using a git worktree branch for my built theme directory and was able to successfully load this into another store, but not on this particular one.

There is no documentation or extended information on why the branch or theme may be invalid, so how are you meant to debug this?

Replies 12 (12)
Michel_Arteta
Shopify Partner
21 2 29

Check if you have your config folder. if it's missing Shopify will take this as invalid. If that doesn't work let me know. 

beschloo
New Member
4 0 0

Micheal ~
Having the same issue. I have checked my folder structure and do have the config folder you speak on.

Any other tips on how to solve for this?

beschloo_0-1633380986555.png

 

109-marzouk
New Member
1 0 0

Did you figure out what is the cause for this error?

beschloo
New Member
4 0 0

Even though I'm not using it while developing, iv added the `config.yml` file to my root folder and this seemed to work. ¯\_(ツ)_/¯ 

Jumbotron
New Member
3 0 0

Could you expand on that? Where did you add config.yml to make this work?

beschloo
New Member
4 0 0

beschloo_0-1634417102612.png

config.yml added to root folder

Jumbotron
New Member
3 0 0

Where did you get the config.yml?

 

Just make it in github?

 

beschloo
New Member
4 0 0

Correct. 

Just create the file. Nothing has to be in it.

Jumbotron
New Member
3 0 0

I added a config.yml file to the root folder then pushed to my github repo

 

I tried it empty and with the code from in here https://shopify.dev/themes/tools/theme-kit/configuration-reference#config-file

 

Still getting the error message... Any idea why?

Anonymous
Not applicable

Hey Im not sure if anyone is still having this issue but maybe this will help. Once you Initialize your theme and then name your theme via the shopify cli, make sure you change directories so that you are inside of that theme folder you named earlier and then try pushing to your empty respository on github. Inside your actual theme folder first run shopify theme check (You shouldn't have a whole bunch of errors and missing folders, only 1 offense, if you get 100s of offenses then you most likely aren't in your actual theme folder) . Next run  git init, git remote add origin yourrepositorylinkgit add . , git commit -m "initial commit lol" . For the last step i opted to use git push origin master. Let me know if this helped anyone.

 

In conclusion you want to make sure you are pushing your actual theme folder to the empty respository and not its parent directory(folder).

joelwe
New Member
1 0 1

What worked for me was to first download the theme file to my computer. Then unzip the theme files into a folder. Then create a repo on Github. Then git add all theme files and push it to the repo. Then go to Theme library > Add theme > Connect from Github.

JamesLiang
Shopify Partner
2 0 0

Hi @joelwe Thx, I follow your method, and it works for

JamesLiang_0-1653827736710.png