AngularJS で静的サイトを作成しましたが、Github ページとしてアップロードしたいと考えています。ここのすべての指示に従いました
https://help.github.com/articles/creating-project-pages-manually
という名前の新しいブランチを作成し、gh-pages
すべてgit push origin gh-pages
のコンテンツを問題なく作成できます。レポに行くと、gh-pages
そこにあるすべてのファイルを含む新しいブランチが表示されます
https://github.com/siddhion/maxmythic_angular/tree/gh-pages
問題は、http://siddhion.github.io/maxmythic_angular/で自分のサイトを表示しようとすると、404 ページが表示されることです。index.html
問題は、トップディレクトリに自分がいないことだと思います。実際にはapp
ディレクトリにあります。私のディレクトリ構造は、Yeoman を介して作成したため、このように見えます。トップレベルにすべてのファイルが必要だと思います。それとも、この仮定で間違っているのでしょうか?
AngularJS の静的サイトを適切に表示するにはどうすればよいですか?
アップデート
スティーブンが提供した手順に従いました。ステップ 3 に進み、エラーが発生しました。
$ 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.
私はそれから試しました
$ git pull origin master
From github.com:siddhion/maxmythic_angular
* branch master -> FETCH_HEAD
Already up-to-date.
その後、再試行git subtree push --prefix dist origin gh-pages
しましたが、同じエラーが発生しました。
Yeoman の展開ページで、いくつかの一般的なエラーセクションの下に表示されます
現在のブランチのヒントが遅れているため、この更新が拒否されたというエラーが表示される場合があります。これは、リモートに強制的にプッシュすることで解決できます (ただし、既存のものはすべて破棄されることに注意してください)。
私はsubtree push
一般的にgitを初めて使用し、何が破棄されるかわからないため、強制するのが心配です。つまり、私は現在gh-pages
maxmythic_angularorigin
リモートにブランチを持っていないので、それについては心配していませんが、そこにmaster
,gh-pages-old
とgh-pages-v1
ブランチがあります。実行すると、それらは破壊されますgit subtree push --prefix dist origin gh-pages
か?