Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

The branch used for GitHub Pages should be configurable #212

Open
stuartpb opened this issue Jun 17, 2014 · 8 comments
Open

The branch used for GitHub Pages should be configurable #212

stuartpb opened this issue Jun 17, 2014 · 8 comments

Comments

@stuartpb
Copy link

Right now the way GitHub Pages work is kind of inconsistent:

  • If the name of the repository is something.github.io, it pulls from the master branch.
  • If it's anything else, it pulls from the gh-pages branch.

In either case, it will create a virtual host for whatever domain you list in the CNAME file, as well as a directory under the user or organization on github.io.

The shortcoming of this means that, if you have a repo that exists only to be used for GitHub Pages, you have to use "gh-pages" as the name of your default branch (unless you're also using it as your github.io repo, in which case that will break and you need to use "master" instead).

(Also, from what I can tell with https://github.com/plushu/plushu.github.io, if you rename a repository to or from username.github.io, it loses all track of where it's supposed to pull from and everything just goes straight to hell.)

GitHub allows users to configure which branch of the repository acts as the default branch: GitHub should also allow users to choose which branch is used for files on GitHub Pages

Allowing users to more freely use other branches as for GitHub Pages (such as the master branch of a JavaScript library) would also make it much smoother to host your libraries directly from GitHub as a CDN (a feature users are themselves trying to hack with solutions like RawGit).

@stuartpb stuartpb changed the title GitHub Pages should be a configurable branch The branch used for GitHub Pages should be configurable Jun 17, 2014
@Mithgol
Copy link

Mithgol commented Jul 1, 2014

“GitHub is mainly made for serving code repositories that are likely to change often, they set cache expires very low. A CSS or JavaScript is set to 10mins which isn't ideal performance-wise.”

That means that using GitHub as a CDN is probably not the optimal way.

Other than that, a custom name for the GitHub Pages branch is a very good idea.

@stuartpb
Copy link
Author

GitHub now allows users to select the source for GitHub Pages from a few different options, including the root of the master branch - not quite the range of configurable choices I would hope for (I would hope they'd at least make the default branch an option, when it's not called "master"), but it's certainly an improvement.

@waterplea
Copy link

Would be awesome to have ability to launch multiple branches to try PRs before merging.

@ksdavidc
Copy link

ksdavidc commented Apr 1, 2020

@waterplea hear hear!

@kmcclellan
Copy link

This would be nice to have, especially now with the IETF recommendation against the use of the word "master." It should use the default branch or gh-pages.

@alexjoybc
Copy link

Agree @kmcclellan, our team is considering moving to main branch but our live doc is hosted on github pages, as an alternative we will keep the 2 branches in sync...

@JRDetwiler
Copy link

I just moved my website over to main because I heard the migration announcement. I assumed it was mandatory. Now I just found out that my site went down after the switch and I have to switch it back...Pages requires the master branch.

@floehopper
Copy link

I just moved my website over to main because I heard the migration announcement. I assumed it was mandatory. Now I just found out that my site went down after the switch and I have to switch it back...Pages requires the master branch.

I just had exactly the same experience. It's frustrating that GitHub Pages was just silently disabled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants