(1) Create a new empty github repository:

如何将web应用部署在Github page上

The local project has the following folder structure:
lib( folder )
|- angular.js
angular_controller.html
Follow the instructions in above picture to push the local project to github. Once done, it should look like below:

如何将web应用部署在Github page上

(2) use command git checkout –orphan gh-pages to create a new branch named “gh-pages”.

如何将web应用部署在Github page上

Add all files in local project to this branch and push them to github again via command:

git push origin gh-pages
Once done, you should find a new branch gh-pages in github now.

如何将web应用部署在Github page上

Switch to this branch:

如何将web应用部署在Github page上

Click the hyperlink of html, and you get the following url in browser:
https://github.com/i042416/jerry_test/blob/gh-pages/angular_controller.html

如何将web应用部署在Github page上

The url for this Angular application hosted in github is:
http://.github.com/<repository_name>/angular_controller.html
As a result in my example, the url is:http://i042416.github.io/jerry_test/angular_controller.html
Test in browser and it works now:

如何将web应用部署在Github page上

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
如何将web应用部署在Github page上

相关文章:

  • 2021-12-23
  • 2021-09-25
  • 2021-11-28
  • 2021-12-01
  • 2021-08-21
  • 2021-07-17
  • 2021-04-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-24
  • 2022-01-08
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
相关资源
相似解决方案