Reputation: 13681
Say I have the following repositories on GitHub:
caffinatedmonkey (user)
│
├── caffinatedmonkey.github.io
│ └── tree
│ └── master
│ └── foo
│ └── index.html
└── foo
└── tree
├── master
└── gh-pages
└── index.html
If I go to caffinatedmonkey.github.io/foo, which page will be shown? Which page takes precedence, the project page, https://github.com/caffinatedmonkey/foo/tree/gh-pages/index.html
or the user page, https://github.com/caffinatedmonkey/caffinatedmonkey.github.io/tree/master/foo/index.html
?
Upvotes: 4
Views: 155
Reputation: 13681
I set up a test by replicating the repository structure in the question. When I visited caffinatedmonkey.github.io/foo
I was taken to the user's foo page, https://github.com/caffinatedmonkey/caffinatedmonkey.github.io/tree/master/foo/index.html
.
User pages take precedence.
Upvotes: 1
Reputation: 634
User pages "take precedence", but not in a per url basis. Even if the urls don't collide, having a user page disables project pages.
In order to work arround this you can have the gh-pages branch of a project page set up as a submodule of your user.github.io
repo.
cd user.github.io
git submodule add -b gh-pages https://github.com/user/project.git
git submodule update
git commit -m 'Added submodule for project'
git push
Upvotes: 3