Important: the repo can’t be empty, you need to have at least the basic folder structure set up in the repo. Add the basic files as well (theme.liquid, etc), even if they’re empty for now.
Your theme folders must be in the root of the branch you’re working on, for example, if we look at Dawn’s repo we can see that the main theme folders are in the root of the ‘main’ branch and are not contained within a parent folder: example folder structure
If you’d like to structure your project in such a way that your theme files are in a folder within the root, you’d need to setup some github workflows that will extract the main theme folders out of the parent folder and push that into a separate branch each time you merge into your main branch – you’d then use the separate branch when linking via GH.
So the simple solution is to just take your theme folders out of any parent folder they might be in and place them in the root of your project instead, after doing so you should not see the error any longer when trying to link your theme via GitHub.
2
Answers
It could be because:
bananasofa/hydrogen
repositoryYou can see it discussed here, with comments like:
At the very least, it needs a
config.yml
In case anyone else has the same issue..
Important: the repo can’t be empty, you need to have at least the basic folder structure set up in the repo. Add the basic files as well (theme.liquid, etc), even if they’re empty for now.
Your theme folders must be in the root of the branch you’re working on, for example, if we look at Dawn’s repo we can see that the main theme folders are in the root of the ‘main’ branch and are not contained within a parent folder:
example folder structure
If you’d like to structure your project in such a way that your theme files are in a folder within the root, you’d need to setup some github workflows that will extract the main theme folders out of the parent folder and push that into a separate branch each time you merge into your main branch – you’d then use the separate branch when linking via GH.
So the simple solution is to just take your theme folders out of any parent folder they might be in and place them in the root of your project instead, after doing so you should not see the error any longer when trying to link your theme via GitHub.