Can't disable GitHub Pages for this repository

I recently moved to Netlify for deploying my jekyll site. I tried to disable my github pages site using these instructions, but I see this error when I select the “none” branch:

You can’t disable GitHub Pages for this repository. Read more on how to unpublish your GitHub Pages site.

The offered link just leads back to the same instructions. How can I unpublish my github pages site? Thanks!

I’m having this same issue. In my case the repository name is still in the username.github.com format that used to be part of the GH Pages configuration (I think legacy), using the master branch. All of that still works fine to deploy to Netlify.

Does it require renaming the repository? Not sure @DavidSchirduan if yours is set up like this, as well…

Yup, mine’s setup the same way. I tried creating and deleting branches, but github pages just grabs whatever is set as the default branch. I don’t want to delete the repo, but I will if I have to.

It’s not great that github FORCIBLY publishes my site now.

1 Like

Hi @DavidSchirduan and @colemanm, welcome to the GitHub Support Community!

GitHub Pages sites served from repositories that use the special naming scheme username.github.io can’t be unpublished as it’s expected that a Pages site will be served from these repos. In order to disable Pages for these repositories you’ll need to first rename it to something else.

I’ll pass this on to the documentation team though, there should be something on this page that explains why you aren’t able to disable Pages for these specific repos on that help page.

1 Like

Thanks @thomasshaped!

I thought it might be this but didn’t want to touch the names unless it would work. I’ll rename with something else and see if I can get it working. :+1:

1 Like

GitHub Pages sites served from repositories that use the special naming scheme username.github.io can’t be unpublished as it’s expected that a Pages site will be served from these repos.

After I changed the repo name I was able to switch the github pages branch to “None” which seems to have disabled the build process.

Thank you!

1 Like

The old documentation said that to unpublish a GitHub Pages site, you had to delete the branch that was the publishing source of the Pages site. If using a user site and publishing from the master branch, you first had to set another branch as the default before deleting master. (I’ve linked to an old version of GitHub Enterprise documentation because I couldn’t find an old version of Github documentation, but the instructions were similar).

I tried that and it worked. The site was unpublished and I didn’t have to rename the repo. I don’t know if this will be disabled in the future (so you really can’t unpublish a Pages site unless you delete or rename the repo), or if it’s the documentation that doesn’t cover it, but I thought I should leave a comment since you mentioned that you’ll notify the documentation team to make some changes.