如何在github上預覽html檔案
阿新 • • 發佈:2018-12-21
1.最簡單的方式就是直接在你github地址中的html檔案前面加上http://htmlpreview.github.com/?
舉個栗子:http://htmlpreview.github.io/?https://github.com/djz917/Game/blob/master/2048/index.html
2.可以利用gh-pages分支來簡化網址
a.如何你github倉庫中沒有專案那麼就先新建一個
在本地專案資料夾下執行命令列工具
1.git init
2.git add --all
3.git commit -m '上傳說明'
4.git remote add origin +新建倉庫地址
5.git push -u origin master
b.這時你已經有了一個網上倉庫了,那麼我們來切換分支
1.git branch gh-pages
2.git checkout gh-pages
3.git push -u origin gh-pages
那麼直接訪問username.github.io/專案目錄