Unable to change source branch in GitHub Pages

前端 未结 3 589
离开以前
离开以前 2021-02-01 13:29

I have created a simple web site for GitHub Pages. The source of the site is in the \"master\" branch and the generated web site (what I want to see published) is under the \"gh

3条回答
  •  囚心锁ツ
    2021-02-01 13:54

    Personal or organization sites are built from master. gh-pages branch is used to build sites for projects.

    As far as I can see, you're using https://user-name.github.io/ url, this is a personal one, so that's why master branch is the default one.

    See the documentation page

    If your site is a User or Organization Page that has a repository named .github.io or .github.io, you cannot publish your site's source files from different locations. User and Organization Pages that have this type of repository name are only published from the master branch.

    So the answer is No, you can not change it. You'll have to adjust your workflow and keep development in another branch (let's call it development) and merge to master when you're ready to publish.

    UPD: It's 2020 out there, so as of July 31st GitHub Pages allow you to configure any branch to act as an old master

提交回复
热议问题