创建项目GitHub Pages时找不到gh-pages选项求助
Hey there! I’ve run into this exact issue before, so let’s walk through the most common reasons why you might not see the gh-pages option:
You don’t have a
gh-pagesbranch in your repo yet
GitHub Pages looks for this branch by default, but if you’ve never created it (either locally and pushed to GitHub, or directly in the GitHub repo interface), it won’t show up as an option. Head over to your repo’s branches page, create thegh-pagesbranch, push your static content to it, and then check the Pages settings again.You’re setting up a user/organization site
User or organization GitHub Pages require a repo named exactlyyour-username.github.io(oryour-orgname.github.io). For these sites, GitHub uses themain(ormaster) branch by default—there’s no option to selectgh-pageshere because it’s hardcoded to the primary branch.Your repo is private and you don’t have a paid GitHub plan
Free GitHub accounts don’t support GitHub Pages for private repos. If your repo is private, you’ll either need to make it public, or upgrade to a Pro, Team, or Enterprise plan to unlock Pages for private repos.You don’t have admin permissions for the repo
If you’re not the owner or an admin of the repo, you might not see the full Pages settings. Reach out to the repo admin to confirm you have the right permissions to modify Pages settings.GitHub Pages is disabled for the repo
In rare cases, if the repo has been flagged for violating GitHub’s terms of service, the Pages feature might be disabled entirely. If you suspect this, check your repo’s notifications or reach out to GitHub support.
内容的提问来源于stack exchange,提问作者wang

