xai1981's blog

http://twitter.com/xai1981

git コミットの際のエラー対応

以下のようにコミットしようとしたらエラーが出ました

git commit -m 'refs #3644

* メニュータブに色を追加
* 検索系のフォーム等を小さく表示する
' app/views/schedules/index.blade.php

エラーメッセージ

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <hoge_app@personal.hoge>) not allowed

Eメールアドレスとユーザー名を設定すれば良いそうです

git config --global user.email "hoge@etc.com"
git config --global user.name "hg10066"

設定後の確認

[hoge_app /var/www/hoge/current]$ git config --list
user.email=hoge@etc.com
user.name=hg10066
...

git commit 成功しました

[hoge_app /var/www/hoge/current]$ git commit -m 'refs #3644 ...' app/views/schedules/index.blade.php
[feature/3644_hoge_repair f196401] refs #3644
 6 files changed, 37 insertions(+), 34 deletions(-)
参考サイト