Creating a site unlinked to a repo

I see a lot of posts where you have unlinked the git repo for users who are running their own builds.e.g.

I am building a fresh site that I would like to be unlinked. I tried creating a site in Netlify but there is no way to create without specifying a repo.

Could you please create a new site that is unlinked for me? Is that possible? thks

@mjgs When you go to the “main page” of your Netlify dashboard, there is a button at the top right that offers to create a “New site from Git”.

However, if you scroll to the bottom of the page, you will find a drag-n-drop section when you can upload a ZIP file of your new site – no git repo needed.

@gregraven I don’t see that, there is only GitHub, Bitbucket and GitLab links

hey @mjgs, is drag n drop what you are looking for?

No I just want to create an empty site.

I tried using the Netlify cli:

netlify sites:create

How do I specify the team?

I read the docs but did not see it, is there an environment variable to set the team?

I got this working using a bash heredoc:

netlify sites:create --name “$(head /dev/urandom | tr -dc a-z0-9 | head -c 20)” << ANSWERS
$NETLIFY_TEAM
ANSWERS

So the script feeds the interactive session with the team name. It would be great to have this in an env variable though, because I wasn’t able to pass the empty string via the heredoc, so had to generate a random string, but it might be better to have Netlify generate the site name.

Does anybody know how to pass an empty string value via a heredoc?

Also Is there an env variable for the team name?

Hi, @mjgs. There is no environment variable for the team name. The access to the team is controlled via an auth token for the user making the changes.

There is an environment variable for this auth token though (named NETLIFY_AUTH_TOKEN)! :smiley:

There is more documentation about this (including the environment variable) here:

If there are other questions or concerns, please let us know.

Thanks @luke, you might consider adding an env variable and/or cli flag for the team name, it would make writing scripts easier. I know about the auth token variable, I am already using it in my scripts.

Hi, @mjgs.

$ netlify help sites:create
Create an empty site (advanced)

USAGE
  $ netlify sites:create

OPTIONS
  -a, --account-slug=account-slug                              account slug to create the site under
  -c, --with-ci                                                initialize CI hooks during site creation
  -m, --manual                                                 Force manual CI setup.  Used --with-ci flag
  -n, --name=name                                              name of site
  --debug                                                      Print debugging information
  --httpProxy=httpProxy                                        Proxy server address to route requests through.
  --httpProxyCertificateFilename=httpProxyCertificateFilename  Certificate file to use when connecting using a proxy server

DESCRIPTION
  Create a blank site that isn't associated with any git remote.  Does not link to the current working directory.

Are you looking to control which account the site is created under? If so, use the -account-slug option for that.

If you want to get the default team that is returned by netlify status (and you might also use the --json option if you want to pipe that output as input to another program).

Regarding the environment variable, are you saying that you want the Netlify CLI tool to create the environment variable in your local system environment variable with the default team name at Netlify for the auth token being used?

@luke I didn’t think to use cli help, was just going by what was in the docs, thanks for the cli help output.

What is account? Is that equivalent to team?

I’m just trying to pass the right args so as not to be prompted for them. Currently the prompt asks for a team name, so I’m looking for either an environment variable the cli tool would read or a cli flag.

“Account” and “team” are used interchangeably here. Note, this option uses the “slug” for the team. This is the string in the URL for the team when you visit the team setting pages.

For example, if this is my billing URL:

https://app.netlify.com/teams/example/billing/general

then the “account slug” above is “example”. It is the string between “teams/” and “/billing” above.

If you use that option, you will not be prompted for a team. If there are other questions, ask anytime. :+1:

Thanks @luke - I will give that a try next time I am creating a site.