I'm doing some basic demos with javascript pages - using github not only as source control but also as a hosting provider.
I'd like to work only on the gh-pages branch, or have it automatically reflect my changes on master, whatever is easier and cleaner.
I tried to delete the master branch but it won't let me:
$ git push origin --delete master
remote: error: refusing to delete the current branch: refs/heads/master
To [email protected]:opensas/geo-demo.git
! [remote rejected] master (deletion of the current branch prohibited)
I just want to have a single branch (master or gh-pages) and whatever I commit and push to it to appear in the github pages.
What is the best way to accomplish this?
app, change directory back to the parent folder, setup a "gh-pages" subfolder for your "gh-pages" branch and change directory into it. Clone your "grandmaster" repository into the "gh-pages" folder (this will clone in the "master" branch), checkout the "gh-pages" branch, list the files (should have "index. html" and ".
You no longer have to use gh-pages . @DanDascalescu It's not true. You can only use the master branch, or the master branch's docs folder, or gh-pages.
Go to your GitHub repository, click on the settings tab, and scroll down to the GitHub Pages section. The branch should be configured to gh-pages and the folder set to / (root) as illustrated below. Note the URL for the website, you will use it later in the guide.
If you want to remove master from GitHub you have to go to GitHub and set gh-pages as your default branch. Only then can you delete master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With