I have created a static site with AngularJS and now want to upload it as a Github Page. I have followed all the instructions here
https://help.github.com/articles/creating-project-pages-manually
I can create a new branch named gh-pages
and git push origin gh-pages
all my content just fine. When I go to my repo I see the new gh-pages
branch with all the files there like so
https://github.com/siddhion/maxmythic_angular/tree/gh-pages
The problem is that when I try to view my site at http://siddhion.github.io/maxmythic_angular/ I just get a 404 page. I assume that the problem is that I don't have my index.html
in the top directory. It is actually located in the app
directory. My directory structure looks the way it does because I created it via Yeoman. I assume I need all the files in my top level. Or maybe I am wrong in this assumption?
How would I get my AngularJS static site to show up properly?
UPDATE
I followed the steps that Stephen provided. I got to step 3 and I got an error:
$ git subtree push --prefix dist origin gh-pages
git push using: origin gh-pages
To git@github.com:siddhion/maxmythic_angular.git
! [rejected] 5db3233d7c0822eedc5500409ce6a2d4b73ad427 -> gh-pages (non-fast-forward)
error: failed to push some refs to 'git@github.com:siddhion/maxmythic_angular.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I then tried
$ git pull origin master
From github.com:siddhion/maxmythic_angular
* branch master -> FETCH_HEAD
Already up-to-date.
and then tried git subtree push --prefix dist origin gh-pages
again but got the same error.
At the Yeoman deployment page I see under the Some common errors section
You might get an error like this Updates were rejected because the tip
of your current branch is behind. You can solve this by force pushing
to the remote (be careful though, it will destroy whatever is already
there).
I am apprehensive to force the subtree push
because I am new to git in general and not sure what is going to be destroyed. I mean, I currently do not have a gh-pages
branch at my maxmythic_angular origin
remote so I am not worried about that but I have my master
, gh-pages-old
and gh-pages-v1
branches there. Will they be destroyed if I run git subtree push --prefix dist origin gh-pages
?