Question

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?

Était-ce utile?

La solution 2

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.

Autres conseils

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top