12

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.

15

Simply delete the gh-pages remote branch:

$ git push origin :gh-pages
5
  • 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. Jan 14 '20 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. Sep 4 '20 at 12:36
  • 1
    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. Sep 4 '20 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
    Feb 17 '21 at 3:56
  • Oh I've also tried this answer but it says "remote ref does not exist".
    – Gray
    Feb 17 '21 at 3:57
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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