LoginSignup
12
11

More than 5 years have passed since last update.

github-pages導入手順

Last updated at Posted at 2014-01-26

pasberth氏のレクチャーのもと、
github pageをオープンできるようになったので、忘備録。

GitHubにアカウントを作って
メールアドレスの認証(verify)を事前に済ませていること前提。


//GitHubにてリポジトリを作成
https://github.com/new
//自分のローカルディレクトリを作成し、リポジトリを取得する(sampleRepoを作った場合)
git clone https://github.com/<accountName>/sampleRepo.git
cd sampleRepo
touch README.md
git add README.md
git commit -m init

git push origin master

これからリポジトリに新しくなにかファイルを追加したかったら

git add <filename>
git commit -m "add <filed>"
git push origin master

//試しに hello world と書かれた html を追加した場合
echo hello world > index.html
git add index.html
git commit -am "add index.html"
git push origin master

この index.html を
GitHub pages を利用してWeb上に公開します。


http://<accountName>.github.io/sampleRepo/

(今はまだ GitHub pagesを使えてないため、404の状態)
いま作った index.html を GitHub pages を使って公開するには,

git branch gh-pages
git push origin gh-pages

上記のコマンドを入力した後、URLを叩いて「Hello world」が表示されれば成功。


gitのコマンドの学習と
どういうサイトを作ろうかっていうのを考えないといけない

12
11
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
12
11