Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github page shows master branch, not gh-pages

Tags:

git

github

I've managed to push files to the master branch of my repo as well as a second branch called gh-pages. When I launch mysite.github.io it shows the contents of the master branch. Is there a way to redirect it to gh-pages instead?

I'm doing this from the Mac terminal.

like image 458
Sebastian Avatar asked Aug 28 '14 22:08

Sebastian


People also ask

Where is my GH page branch?

You need first to perform a "git fetch" or a "git pull" so that your clone is up-to-date with the server. You should then see the branch as a remote branch "remotes/origin/gh-pages" with the command "git branch --all".

Why is GitHub not showing pages?

Scroll down a bit, there is GitHub Pages settings. Try to select different source from "Select source" dropdown/combobox and save. Then change it again into gh-pages branch and don't forget to save.


1 Answers

It sounds like you're confusing User / Organization pages with Project pages.

User / Organization pages live in a specially named repository called username.github.io, and publish from the master branch. They can be browsed at http://username.github.io.

Project pages can be part of any repository, and are published from the special gh-pages branch. They can be browsed at http://username.github.io/project-name.

If you want to have a project page, make sure that your repository is not named after your GitHub user name. If you want your project to be available at http://username.github.io, you must have a User / Organization Page, which must publish from the master branch.

like image 87
Chris Avatar answered Sep 19 '22 03:09

Chris