Francis Hurtubise
Francis Hurtubise

Reputation: 45

Does Github Pages use Master?

I am currently working on my website, and the thought of continuously working on master is not so welcoming since my site is now official (before it didnt have a domain name, but now it does). And I want to test some things then merge them into master. This question might be out of place, but if I make a new branch, let's say called "testing", will it, or will it not affect my site? (I dont believe so, but I just want to make sure), and i would proceed as normal to merge with master to make the changes live?

Upvotes: 1

Views: 278

Answers (1)

Joel Glovier
Joel Glovier

Reputation: 7679

Generally speaking yes, but it depends whether you are using a User/Org page or a Project page. The difference is:

User/Org Pages

  • repo name must follow the naming format github.com/username/username.github.io
  • Pages production content is based on Master
  • Your site will live at username.github.io (can also use a custom domain via CNAME file in base of the repo)

Project Pages

  • repo name can be anything that you want
  • Pages production content is pulled from an orphan branch you must create and name gh-pages
  • Your site will live at username.github.io/projectname

So, yes, assuming you are using a user Pages setup, Pages publishes your site from Master. So any branches you create will not affect your content in production until you merge it into master.

More info available at GitHub Pages Help or in this Jekyll docs article.

Note: I work for GitHub.

Upvotes: 1

Related Questions