Programmatically enable Github Pages for a repository

两盒软妹~` 提交于 2019-12-05 13:15:51

You just have to push content to the remote git repository.
You have to differentiate between a User-Page (username.github.io) and a Project-Page (username.github.io/projectname)

User-Page:

git clone https://github.com/username/username.github.io
cd username.github.io

echo "Hello World" > index.html

git add --all
git commit -m "Initial commit"
git push -u origin master

Project-Page:

git clone https://github.com/user/repository.git
cd repository

git branch gh-pages
git checkout gh-pages
echo "Hello World" > index.html

git add --all
git commit -m "Initial commit"
git push -u origin gh-pages
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!