Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github Pages Dev Branch?

Tags:

github-pages

I currently use the lovely Github Pages to host a website. I would now like to try out some stuff, adding content, new scripts, ... So I have a dev branch in which I do this, and run a local webserver to test it. Once I'm happy with it I can push it to the gh-pages branch for 'release'.

However, I was now wondering. Is it possible to have the dev branch also be reachable anywhere just like the gh-pages branch? This would be very helpful in letting other people try out the new stuff I'm working on without having to risk releasing buggy code to everyone. So basically two gh-pages sites in one repo, one for release one for development.

Is this (or something similar) possible with Github?

like image 771
The Oddler Avatar asked Sep 17 '15 11:09

The Oddler


People also ask

Which branch does GitHub Pages use?

git checkout gh-pages means you've switched to the branch named 'gh-pages'. Any change you commit to this branch is picked up by github to build your github pages. To switch back to the 'master' branch (presumably your source code), do git checkout master .

How do I switch to 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.

Can GitHub Pages have backend?

Github pages will not execute any serverside code. You may only upload static files (html,css,js, images, etc.). In order to have a hosted backend you should look for another service like Google Cloud, AWS Lambda, Heroku, etc.


1 Answers

So going carefully through the github pages documentation seeking for any solution using the offered functionalty it seems what you are looking for might have been nice but is not available, maybe the closest thing is to have two repositories for example username.github.io/production and another one that is forking it like username.github.io/development and working on it while pushing changes back to the production one using pull requests or any technique you would prefer

And if you like you can check out my post and see some techniques of altering your websites, as well jekyll has a _drafts directory which allows staging of a post and seeing it before being posted.

like image 77
Yehonatan Levi Avatar answered Sep 25 '22 03:09

Yehonatan Levi