Reputation: 6718
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?
Upvotes: 44
Views: 15287
Reputation: 266
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.
Upvotes: 22
Reputation: 1166
I think any branch can be reached via rawgit.com.
For example, if your user/organization is XYZ, you can reach the dev
branch for your user/organization jekyll site at:
http://rawgit.com/XYZ/XYZ.github.io/dev/_site/index.html
Just don't include _site
in .gitignore
. You still have to build the site locally with jekyll build
, so it's still not a perfect solution.
Upvotes: 3