コミットログ編集に使うエディタを指定する
vimをインストールしてみる。
- 香り屋 — KaoriYaからダウンロード
- 解凍してCディレクトリの下に置く
- フォルダ名が長かったので「vim」に変更
- パスを通す。(環境変数に「C:\vim」を追加)
gitのエディタに指定する
git config --global core.editor 'gvim -c "set fenc=utf-8"'
コミットしてみる
git commit
でgvimが起動する。
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html #
こんなのが書かれてる。
ログメッセージの形式は
- コミットがする変更の内容を1行で要約
- 1行の空行
- 変更した理由の説明
なので、
ページにタイトルを追加 titleタグが使われてなかったので追加しました # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html #
てな感じに書く。保存してエディタ閉じればコミット完了。
何も書かずにエディタ閉じればコミットキャンセル。