TruthSeeker
TruthSeeker

Reputation: 128

Which will get Priority between "github pages" and "directory kept at root" in case of name conflicts and why

Say I have an index.html put on my username.github.io, which I can visit by the url, http://username.github.io

Now consider 2 conflicting cases

  1. Say, I have a repository named repo1 with gh-pages activated. So, it should be available at http://username.github.io/repo1
  2. I also have put a folder named repo1 with an index.html inside it, at the username.github.io location.

Here's my question

Now, if I visit from my browser the url http://username.github.io/repo1 which one of 1 or 2 will be served? and more importantly WHY ?

Upvotes: 3

Views: 145

Answers (1)

Suman Barick
Suman Barick

Reputation: 3411

I tested it with my github repo sumanbarick.github.io.

Finding: Repository (github pages) will get priority in case of name conflict.

Test 1: http://sumanbarick.github.io/test/

  1. First I made a repository name test with an index.html inside it. Created branch gh-pages. I tried the url http://sumanbarick.github.io/test/ and I got the page index.html.
  2. Then I created a folder named test and an index.html inside it in sumanbarick.github.io repo
  3. I hit the url again. But still got he index.html from the repo

Test 2: Does 1st defined gets the 1st priority?

  1. This time I made a folder named test2 and an index.html inside it in sumanbarick.github.io repo. I tried the url http://sumanbarick.github.io/test2/ and I got the page index.html from folder test2
  2. But as soon as I created the repo test2 with gh-pages, the result of the url favored the index page of the repo

So, this is a partial answer. And now we know,

Q. Which one will get priority?

A. The repo (Go to the above mentioned url and see for yourself).

Q. Why?

A. I am still curious about this WHY part. Let's see what others say.

Upvotes: 3

Related Questions