So I want to locally locally dev a new code spike.
But I have to link it to a site first.
But it’s not in git and so after much searching if found drop zone hidden away at bottom of page
But my code is in Windows WSL and I can’t drag and drop form the CLI
Is there a way to get code into a site without git or GUI file explorer?
I agree but I started using “netlify dev” in the cli. That is what insists I have a site and then all the problems follow.
As far as I know I cannot create a site with the cli from the folder I am in. The docs all point to creating sites with the ui and using git.
But yes, I’ll explore the cli more in case there’s an option I missed.
I used to just use netlify dev in any folder to fire up a web server. That was really nice. But now it appears I cannot. Or perhaps it’s as I have a netlify.toml in this case?
netlify init will create a site for you from the command line. Once you have that, you can use netlify dev to test your site locally (including functions) and netlify deploy to send your site live.
No need to push to git. Builds and done locally and pushed live.
It worked perfectly thanks and didn’t clobber the toml file as I feared it might.
So in summary the init command is great but the description in the online docs is confusing. It could say something like
Configure local build and dev to work in collaboration with a Netlify site if ione is not already linked. It will et up for manual deployment or CD with git and create and link to a new site in Netlify.
To only create a site you can use netlify sites:create (the init command actually uses the create command under the hood)
You shouldn’t need to link a site to use netlify dev and it even works offline (via the --offline flag). If a site is linked it will read various site settings like env variables, publish directory, etc, but that’s not required for it to work.
@slim one possible issue I can think of is that the project might be linked to a site that no longer exists. In that case netlify dev will try to access the site settings and fail. You should be able to unlink it by running netlify unlink.
If that doesn’t work I recommend opening an issue on the CLI repo so we can investigate why this doesn’t work.
@KyleBlankRollins I’ll add my thoughts on the CLI docs issue you opened.