我的用户网站中的文件夹是否与项目网站冲突?(Does a folder in my user site conflict with a project site?)

编程入门 行业动态 更新时间:2024-10-27 10:20:36
我的用户网站中的文件夹是否与项目网站冲突?(Does a folder in my user site conflict with a project site?)

GitHub Pages允许每个用户拥有一个用户网站 (也许是一个主页)和无限的项目网站

设置用户网站时必须命名repo [username].github.io (其中[username]是您的GitHub用户名),并且默认URL为:

http://[username].github.io/

您在[username].github.io对master分店所做的任何更改[username].github.io上传到您的用户站点。

当你建立一个项目网站时 ,你可以命名你想要的任何回购(我们称之为[projname] )。 网址默认为:

http://[username].github.io/[projname]

您对[projname]的gh-pages分支所做的任何更改[projname]上传到项目站点。

我的问题是,如果在您的用户网站存储库中,您巧合地拥有一个与您的项目网站存储库具有相同名称的文件夹?

例如,假设您的用户网站repo bob.github.io的文件夹temp/中有一个文件index.html 。 然后,该网页将在网上托管

http://bob.github.io/temp/index.html

现在说你创建一个项目网站与回购名称temp 。 在该回购中,您有一个名为index.html的文件。 然后,当你将它推送到gh-pages分支时,它是否将在线托管

http://bob.github.io/temp/index.html

GitHub Pages allows each user to have one User Site (maybe a home page) and unlimited Project Sites.

When you set up your User Site, you must name the repo [username].github.io (where [username] is your GitHub username), and the URL is by default:

http://[username].github.io/

Any changes made to the master branch in your [username].github.io repo are uploaded to your User Site.

When you set up a Project Site, you can name the repo anything you want (let's call it [projname]). The URL is by default:

http://[username].github.io/[projname]

Any changes made to the gh-pages branch in your [projname] repo are uploaded to the Project Site.

My question is, what if in your User Site repository, you coincidentally have a folder that has the same name as your Project Site repository?

For example, say you have a file index.html inside a folder temp/ in your User Site repo bob.github.io. Then that page would be hosted online at

http://bob.github.io/temp/index.html

Now say you create a Project Site with repo name temp. In that repo, you have a file called index.html. Then when you push it to thegh-pages branch, would it be hosted online at

http://bob.github.io/temp/index.html

?

最满意答案

Github支持回复:

是的,他们会发生冲突。 项目网站的网址将为username.github.io/project,用户或组织网站中的文件夹的网址将为username.github.io/project。

我建议您重命名目录或存储库名称。

Github support response:

Yes, they would conflict. The url for Project sites will be username.github.io/project, and the url for a folder in a user or organization site would be username.github.io/project.

I would recommend that you either rename the directory or the repository name.

更多推荐

本文发布于:2023-08-01 00:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1351695.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网站   文件夹   冲突   项目   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!