有没有办法通过api启用Github页面? 不请求页面构建,我的意思是初始启用该功能并指向分支。
答案 0 :(得分:3)
您只需将内容推送到远程git存储库即可 您必须区分用户页面(username.github.io)和项目页面(username.github.io/projectname)
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
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