在Github上托管一个版本库网站不工作?

问题描述:

git clone github.com/ubermankapil/Restaurant.git 
cd repository 
git checkout --orphan gh-pages 
git rm -rf . 
echo "My Page" > index.html 
git add index.html 
git commit -a -m "First pages commit" 
git push origin gh-pages 

我跟着上面的步骤(从https://help.github.com/articles/creating-project-pages-manually/了),之后我参观了库网址: http://ubermankapil.github.io/Restaurant/在Github上托管一个版本库网站不工作?

我没有得到我的网站的实际内容,而这只是显示“我的页”。 如何获取要在该存储库url 上显示的实际内容?

+0

请参阅我的答案的更新,因为我相信它可以解决您的问题。 – intboolstring

echo "My Page" > index.html 此行将我的页面打印到index.html文件 ,这意味着您的index.html文件将只包含单词我的页面。

bash中的运算符是将输出重定向到给定的文件中。 Github页面基于readme.md文件而不是index.html。 使用降价更新您的readme.md。

在快速查看您的回购之后,似乎所有这些都没有必要。

这是你应该做的。

git clone github.com/ubermankapil/Restaurant.git 
cd repository 
git checkout gh-pages 
git pull 

这会给你从gh-pages分支的所有代码。您遵循的说明适用于从头开始的人员。


如果您已经运行了git commit,那么您需要重置。到您的原产地

git reset --hard origin/gh-pages 
+0

它仍然无法正常工作。同样,它在屏幕上显示“我的页面”。 –

+0

你把我的网页后git提交? – intboolstring