これまでに完了した設定をGit リポジトリに保存します。
Git の設定
Git に自分の名前とメールアドレスを設定しておきます。
この設定はコミットログに書き込まれます。
リポジトリをGitHub のようなサイトに公開すれば、誰でも閲覧できることになります。
下の操作、名前の登録、メールアドレスの設定、エディタの設定は「TortoiseGit」で行いました。が、GitBash上でエディタを起動させる場合は下記の設定は必要になります。
過去記事:TortoiseGitの日本語化
$ git config --global user.name "Your Name" $ git config --global user.email you@example.com
Windows では、Git Bash から日本語を入力できませんので、エディタの設定を行います。
次のコマンドはGit のエディタをサクラエディタに設定。
$ git config --global core.editor "C:\Program Files (x86)\sakura\sakura.exe' -CODE=4"
Git リポジトリへの保存
git status コマンドを実行すると、現在の作業フォルダの状況が表示されます。
$ cd ~/work/fuelphp gara@GARA-PC ~/work/fuelphp (1.7/master) $ git status On branch 1.7/master Your branch is up-to-date with 'origin/1.7/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: composer.json modified: composer.phar modified: fuel/app/bootstrap.php modified: fuel/app/config/config.php Untracked files: (use "git add <file>..." to include in what will be committed) fuel/app/classes/controller/check.php fuel/app/config/oil.php no changes added to commit (use "git add" and/or "git commit -a") gara@GARA-PC ~/work/fuelphp (1.7/master)
「modified:」には変更されたファイルやサブモジュールが、「Untracked files:」にはGit で管理されていないファイルが表示。
git diff コマンドを実行すると、変更したファイルの変更点がわかります。
※[END]表示がでた後に抜ける方法は、”q” でEnter。
$ git diff diff --git a/composer.json b/composer.json index 8b03073..e8d063f 100644 --- a/composer.json +++ b/composer.json @@ -161,5 +161,8 @@ "php oil r install" ] }, - "minimum-stability": "dev" + "minimum-stability": "stable", + "require-dev": { + "phpunit/phpunit": "3.7.*" + } } diff --git a/composer.phar b/composer.phar index 68565db..3f02d0e 100755 Binary files a/composer.phar and b/composer.phar differ diff --git a/fuel/app/bootstrap.php b/fuel/app/bootstrap.php index fbdab6a..094140a 100644 --- a/fuel/app/bootstrap.php +++ b/fuel/app/bootstrap.php @@ -2,6 +2,8 @@ // Bootstrap the framework DO NOT edit this require COREPATH.'bootstrap.php'; +// set default charset +ini_set('default_charset', 'UTF-8'); Autoloader::add_classes(array( // Add classes you want to override here diff --git a/fuel/app/config/config.php b/fuel/app/config/config.php index 9cc95bf..2daf3a0 100644 --- a/fuel/app/config/config.php +++ b/fuel/app/config/config.php @@ -78,9 +78,9 @@ return array( /** * Localization & internationalization settings */ - // 'language' => 'en', // Default language + 'language' => 'ja', // Default language // 'language_fallback' => 'en', // Fallback language when file isn't av - // 'locale' => 'en_US', // PHP set_locale() setting, null to + 'locale' => 'ja_JP.UTF-8', // PHP set_locale() setting, nul /** * Internal string encoding charset @@ -94,7 +94,7 @@ return array( * default_timezone optional, if you want to change the serv */ // 'server_gmt_offset' => 0, - // 'default_timezone' => null, + 'default_timezone' => 'Asia/Tokyo', /** * Logging Threshold. Can be set to any of the following: @@ -106,7 +106,7 @@ return array( * Fuel::L_INFO * Fuel::L_ALL */ - // 'log_threshold' => Fuel::L_WARNING, + 'log_threshold' => Fuel::L_ALL, // 'log_path' => APPPATH.'logs/', // 'log_date_format' => 'Y-m-d H:i:s', @@ -121,7 +121,7 @@ return array( /** * A salt to make sure the generated security tokens are not pre */ - // 'token_salt' => 'put your salt value here to make + 'token_salt' => 'bZkHdjHinazQQISwFVqlUo9AVZ2yiwrQtq/ /** * Allow the Input class to use X headers when present
今回はdevelop ブランチにて進めて行く。現在の1.7/master ブランチからdevelop ブランチを作成します。
$ git checkout -b develop M composer.json M composer.phar M fuel/app/bootstrap.php M fuel/app/config/config.php Switched to a new branch 'develop'
リポジトリに保存する設定ファイルをgit add コマンドでインデックスに登録します。composer.lockも登録。
gara@GARA-PC ~/work/fuelphp (develop) $ git add composer.json fuel/app/bootstrap.php fuel/app/config/config.php \ fuel/app/config/oil.php
gara@GARA-PC ~/work/fuelphp (develop) $ git add -f composer.lock
それではコミット。コミットメッセージは「FuelPHP の設定」とします。
$ git commit -m "FuelPHPの設定"
Windows ではGit Bash から日本語を入力できませんので、次のコマンドを実行。設定したエディタが起動しますので、「FuelPHP の設定」とだけ記載して保存してエディタを終了。
$ git commit
これで変更したファイルがGit のリポジトリに保存されました。
ログを確認!! 一番上に今のコミットが表示。
gara@GARA-PC ~/work/fuelphp (develop) $ git log --oneline --decorate --graph * b086877 (HEAD, develop) FuelPHPの設定 * 51ae000 (origin/HEAD, origin/1.7/master, 1.7/master) latest composer.phar * a39ea38 updated the readme for 1.7.2 * f789cb3 updated the change log for 1.7.2 * a80a0be Merged 1.8/develop into 1.7/master * 82f79d7 Added missing v1.6.1. section. Related https://github.com/fuel/fuel/co * 8bdfa36 updated the changelog * 361d443 Merge branch '1.8/develop' of https://github.com/fuel/fuel into 1.7/ |\ | * 0c8170b updated submodule references | * 2a55e98 updated submodule references | * 886ef8e updated submodule references | * 11bb88b updated submodule references | * ebd3629 updated submodule references | * 4c004fa make sure __toString() is doing it's magic. closes #1576 | * 5f9abce updated submodule references | * eff0d09 updated submodule references | * e6237ba render the response body before attempting to process it; closes #15 | * c826423 bumped the versions to 1.8-dev * | a4c35d8 update submodule references * | 1c4e81b updated changelog and contributing instructions * | faea837 bumped the version to 1.7 |/ * 48a8bde updated submodule references * ed8782d updated submodule references * 409cdbe updated submodule references * 4f1dbc0 bumped Upload to 2.0.1
参考サイト:「Git操作の基礎 」
「Git のカスタマイズ – Git の設定」