LoginSignup
40
47

More than 5 years have passed since last update.

GitHub Pagesを使ってサクッとWebページを公開する

Posted at

GitHub Pages用リポジトリ作成

01.png

  • + をクリック
  • New repository をクリック

02.png

  • Repository name を入力。(今回はgithub-pages)
  • Description を入力。(こちらは、必要に応じて)
  • Create repository をクリック

Webページを作成する

$ cd ~/Project/develop/github
$ git clone git@github.com:0084ken/github-pages.git
$ cd github-pages
  • 任意の場所に先程、作ったリポジトリをcloneする
$ echo "Hello world GitHub Pages" > index.html
  • htmlファイルを作成する

GitHubへPush

$ git commit -m 'add:newfile up'
$ git push origin master

Webページを有効にする

03.png

  • Settings をクリック

04.png

  • GitHub Pages セクション内の None をクリック
  • master branch を選択

05.png

  • Save をクリック

06.png

07.png

まとめ

凄まじく簡単です。
masterブランチからできるようになり、別ブランチ(gh-pages)で管理する必要がなくなりました。
(gh-pagesブランチを使った方法も、そのまま利用可能)

参考文献

40
47
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
40
47