LoginSignup
2
2

More than 5 years have passed since last update.

Windows(Win7)でGitHubのGitHub Pagesをつかう その2

Last updated at Posted at 2015-07-14

前回投稿したもののつづきです。 また備忘録的にメモしておきます。

概要

jsdo.itに投稿した、
CreateJS EaselJS 0.6.1 前回コードから戦闘機能を改良 http://jsdo.it/siouxcitizen/cqW8
を GitHub Pages によるWebサイトでホストできるか試してみました。

結果としては GitHub Pages でホストすることができました。
実際に動いているサイトのURLは 
http://siouxcitizen.github.io/CreateJS_0_6_1RPGLikeGame/CreateJS_0_6_1RPGLikeGame.html
htmlファイル、CSSファイル、Javascriptファイルのあるリポジトリは
https://github.com/siouxcitizen/siouxcitizen.github.io/tree/master/CreateJS_0_6_1RPGLikeGame
です。
参考画像
JSRPGLikeGame.png

作業参考情報

  • jsdo.itではhtmlとCSSとJavascriptのファイルがそれぞれバラバラになっているで、GitHub Pages でホストするにあたり、htmlファイルが中心になって他のCSSファイルとJavascriptファイルをインクルードするようにコードを修正しました

  • htmlファイル、CSSファイル、Javascriptファイルは
    文字化けを避けるために「UTF-8(BOM無し)」という文字コードで保存しています

  • 今回作業も前回「mkdir siouxcitizen.github.io」と「cd siouxcitizen.github.io」
    のコマンドでGitHubリポジトリに関連づけつつローカルPCで作成&使用した
    「siouxcitizen.github.io」フォルダを使って行っています

  • 前回同様CUIツール「Git Shell」を使用してコマンドによる作業を行っています

使用GitHubコマンド

以下に今回GitHubでファイルの新規作成、更新、削除を行うときに使用したコマンドを記しておきます

ファイル新規作成時コミット コマンド

git add CreateJS_0_6_1RPGLikeGame.html
git commit -m "first commit"
git push origin master

補足
↑一度 -u を設定すればその後は省略可能っぽい 「git push -u origin master」とする必要なし
↑一度 origin をGitHubのURLに関連付ける設定を行っていればその後は origin を指定するだけ

前回ですでに
「git remote add origin git@github.com:siouxcitizen/siouxcitizen.github.io.git」
「git push -u origin master」
と指定しているので、今回は-uとoriginの設定をしなくても作業を行うことができました

ファイル更新時コミット コマンド

git add CreateJS_0_6_1RPGLikeGame.html
git commit -m "update second commit"
git push origin master

ファイル削除時コミット コマンド

ローカルでCreateJS_0_6_1RPGLikeGame.htmlを削除した後に

git rm CreateJS_0_6_1RPGLikeGame.html
git add ./
git commit -m "delete"
git push origin master

GitHubコマンド参考サイト

commitとpushしかできない人のためのgithubの使い方まとめ
http://myuon-myon.hatenablog.com/entry/20121114/1352906438

削除についてのサイト
githubのファイル削除Add Star
http://d.hatena.ne.jp/hateka/20110804/1312470194
iwaheiもといロックソルジャーのweb(メモ||日記)
http://d.hatena.ne.jp/iwahei0813/20140722/1406030940
サルでもわかるGit入門 基本操作
http://www.backlog.jp/git-guide/reference/basic.html
gitの管理対象から特定のファイル、ディレクトリを削除する
http://qiita.com/ytkt/items/a2afd6be8e4f06c1ea25
GitHubに上げてしまったパスワードを書いたファイルを消す方法
http://qiita.com/iorionda/items/88d6329af997b5c5e748

2
2
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
2
2