简体   繁体   English

Github 页面显示 master 分支,而不是 gh-pages

[英]Github page shows master branch, not gh-pages

I've managed to push files to the master branch of my repo as well as a second branch called gh-pages .我设法将文件推送到我的 repo 的 master 分支以及名为gh-pages的第二个分支。 When I launch mysite.github.io it shows the contents of the master branch.当我启动mysite.github.io它会显示 master 分支的内容。 Is there a way to redirect it to gh-pages instead?有没有办法将它重定向到gh-pages呢?

I'm doing this from the Mac terminal.我正在从 Mac 终端执行此操作。

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. 用户/组织页面位于一个名为username.github.io的特殊命名存储库中,并从master分支发布。 They can be browsed at http://username.github.io .它们可以在http://username.github.io浏览。

Project pages can be part of any repository, and are published from the special gh-pages branch. 项目页面可以是任何存储库的一部分,并从特殊的gh-pages分支发布。 They can be browsed at http://username.github.io/project-name .它们可以在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.如果您想要一个项目页面,请确保您的存储库没有以您的 GitHub 用户名命名。 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.如果你想让你的项目在http://username.github.io上可用,你必须有一个用户/组织页面,它必须master分支发布。

Check this on the repository setting:在存储库设置上检查:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM