Set subdirectory as website root on Github Pages

后端 未结 4 1455
既然无缘
既然无缘 2020-12-22 21:10

I\'m using Github Pages to host & serve a static website.

The static website has the typical directory structure for an app:

|_ source
|_ build
          


        
4条回答
  •  半阙折子戏
    2020-12-22 21:31

    Somehow for me, the accepted answer only runs the first time. Re-doing it throws errors.

    I solved it by running the commands below:

    git checkout --orphan gh-pages
    git --work-tree build add --all
    git --work-tree build commit -m 'gh-pages'
    git push origin HEAD:gh-pages --force
    git checkout -f master
    

提交回复
热议问题