I was playing about with my git repo and tried the GitHub pages feature but I'm not sure how to get rid of it. The check box on the repo admin is disabled.

2 Answers 2


Simply delete the gh-pages remote branch:

$ git push origin :gh-pages
  • 2
    I'm not sure this answer is complete, now that GitHub pages supports different ways to create GitHub pages (master, /docs, etc.). By disabling GitHub pages in the repo settings (and Ctrl-F5 in my browser), I see the pages are gone. Commented Jan 14, 2020 at 15:29
  • How do you disable GitHub pages in the repo settings? I have removed the cname's etc from cloudflare that were pointing to github, and when i go to repo > settings > github pages section, it just says "Your GitHub Pages site is currently being built from the master branch". There doesn't seem to be anyway to delete or disable the github page, it still says "Your site is ready to be published at some-user-name.github.io/some-repo-name." PS The Source section says Branch: master and then /root. Commented Sep 4, 2020 at 12:36
  • 2
    Answer to my own question, not sure if best practise, but I changed Source dropdown value to None and clicked Save and now it says GitHub Pages is currently disabled. Select a source below to enable GitHub Pages for this repository. So I guess that worked. Commented Sep 4, 2020 at 12:42
  • This doesn't seem to work for me. I've moved it back to "none" and pressed Save but I still see: "github-pages Active " on my home page under Environments even though they all show 404 when I click on them.
    – Gray
    Commented Feb 17, 2021 at 3:56
  • Oh I've also tried this answer but it says "remote ref does not exist".
    – Gray
    Commented Feb 17, 2021 at 3:57

Go to the GitHub Pages settings:

repo -> settings -> pages

Change the ‘Source’ dropdown value to ‘None’, and ‘Save’ it. It will then say ‘GitHub Pages is currently disabled.

  • 1
    In my repo, it is now the Branch dropdown, not source. Other than that, this works :-).
    – Froggy
    Commented Nov 1, 2022 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.