Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a folder in my user site conflict with a project site?

Tags:

github

hosting

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

?

like image 730
chharvey Avatar asked Aug 20 '14 03:08

chharvey


2 Answers

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.

like image 164
Shawn Avatar answered Oct 12 '22 22:10

Shawn


I just did the experiment of naming a new repo with the same name as a subfolder in my user site repo:

As a result the new repo took precedence over my personal site.

like image 43
dancab Avatar answered Oct 13 '22 00:10

dancab