LoginSignup
0
0

More than 5 years have passed since last update.

ng github-pages:deployが失敗してCommand failed: git rm -rと言われたけどgh-pagesブランチに適当なファイルを一度コミットしたら成功した

Posted at

GDG神戸主催のAngular2勉強会へ行ってTutorial: Tour of Heroes with Angular-CLIに取り組んだ。

勉強会では Chapter 5: サービス までやって、残りの Chapter 6: ルーティング は自習でやった。

やっと完成したのでGithubに公開したのだけど、コードだけ公開してもつまらないので動く状態で置いておきたい。

調べたら ng github-pages:deploy によって gh-pages ブランチの作成からビルド、コミット、プッシュまで全部やってくれるようなので、なんて便利なんだと感動したわけだけれども、やってみたら失敗する。

Command failed: git rm -r 
usage: git rm [<options>] [--] <file>...

    -n, --dry-run         dry run
    -q, --quiet           do not list removed files
    --cached              only remove from the index
    -f, --force           override the up-to-date check
    -r                    allow recursive removal
    --ignore-unmatch      exit with a zero status even if nothing matched


Error: Command failed: git rm -r 
usage: git rm [<options>] [--] <file>...

どうやらバグで、「もしも既にgh-pagesブランチに過去にビルドしたファイルがあれば消す」という所で、過去にビルドしたファイルが存在しなくても git rm -f を発行してしまうことが原因のように見える。

というわけで、gh-pagesブランチに適当なファイルをadd&commitして、もう一度masterから ng github-pages:deploy したら無事GithubPagesに公開することが出来た

Issueも既に上がっていたのでそのうち治ると思う。

"ng github-pages:deploy" is fail on 1.0.0-beta.22-1 · Issue #3507 · angular/angular-cli
https://github.com/angular/angular-cli/issues/3507

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0