2014-03-24 53 views
3

說我已經在GitHub上的以下庫:GitHub的頁面優先

caffinatedmonkey (user) 
│ 
├── caffinatedmonkey.github.io 
│ └── tree 
│  └── master 
│   └── foo 
│    └── index.html 
└── foo 
    └── tree 
     ├── master 
     └── gh-pages 
      └── index.html 

如果我去caffinatedmonkey.github.io/foo,該頁面將顯示?哪個頁面優先,項目頁面https://github.com/caffinatedmonkey/foo/tree/gh-pages/index.html或用戶頁面https://github.com/caffinatedmonkey/caffinatedmonkey.github.io/tree/master/foo/index.html

回答

0

我通過複製問題中的存儲庫結構來設置測試。當我訪問caffinatedmonkey.github.io/foo時,我被帶到用戶的foo頁面https://github.com/caffinatedmonkey/caffinatedmonkey.github.io/tree/master/foo/index.html

用戶頁面優先。

2

用戶頁面「優先」,但不是在每個網址的基礎上。即使網址不會相互碰撞,但擁有用戶頁面將禁用項目頁面。

爲了解決這個問題,您可以將項目頁面的gh-pages分支設置爲user.github.io回購的子模塊。

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