git - how do I host my app on a github page gh-pages? -
i have following setup of app working on, , host app on github using gh-pages. here hope achieve this.
username@pc1 ~/github/ud989-retain $ ls css index.html js username@pc1 ~/github/ud989-retain $ git status # on branch master nothing commit (working directory clean) username@pc1 ~/github/ud989-retain $ git branch * master below page hosted on gihub gh-pages
# create gh-pages branch git branch gh-pages # think copies files master/origin gh-pates(remotely , locally think?) git push origin gh-pages # shows branches available(master , gh-pages , should on master) git branch # change gh-pages branch git checkout gh-pages #get status of repo, should upto date git status # shows branches available(master , gh-pages , should on gh-pages) git branch # create .nojekyll, not sure required touch .nojekyll # should able see .nojekyll ls -a # add .nojekyll committing, not sure why don't have commit others maybe done git push origin gh-pages git add .nojekyll # commit file comment git commit -a -m "adding .nojekyll file" # gives remote urls, not required checking there git remote -v # push remote repo, , should able view page online git push origin gh-pages so end result 2 branches in github account, master , gh-pages , should have same files. should link page hosted.this can found in settings of git hub account.
edit1 once above done if go yo github page repo , select settings, under gihub pages should have example: github pages site published @ http://hattricknz.github.io/ud989-retain.
note have searched various places this, cannot find document well, or run problems. here hope reference me. there other/better ways of doing similar not aware of.
edit2
just revisiting this: have repo pushed github master branch looks like:
$ ls assets index.html readme.md robots.txt now want publish on github. follow notes
git branch gh-pages git push origin gh-pages git branch git checkout gh-pages git status git branch touch .nojekyll ls -a git add .nojekyll git commit -a -m "adding .nojekyll file" git remote -v git push origin gh-pages but done following: , went settings of repo , said your site published @ .... maybe need do? revisit again...
git branch gh-pages git push origin gh-pages git branch git checkout gh-pages
you should check gh-pages, gives step step documentation
git clone repo.git cd repo git branch --orphan gh-pages add html/css/js files ...than commit , push.
git push origin gh-pages
Comments
Post a Comment