LoginSignup
6
5

More than 5 years have passed since last update.

[Please tell me who you are.] git commitできない時の対処方法

Last updated at Posted at 2019-01-22

[Please tell me who you are.]のエラーでgit commitできない

cloneしたリポジトリ内でファイルを編集しgit commitしようとすると何やらエラーが出ている。

local:Taylor$ git commit -m "modify_local-file"

*** Please tell me who you are.

Run

  git config --global user.email "taylor@example.com"
  git config --global user.name "taylor"

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

fatal: unable to auto-detect email address (got 'Taylor@local.(none)')

**Please tell me who you are.
このエラーはgitで自分の情報を登録していないことが原因のよう。

解決法

git configコマンドで自分のuser.nameuser.emailを設定する。

git configコマンドでemailnameを設定する

local:Taylor$ git config user.email taylor@email.jp
local:Taylor$ git config user.name taylor

設定後もう一度コミットしてみる。


local:Taylor$ git commit -m "modify_local-file"
[master 3ffaf07] modify_local-file
 1 file changed, 36 insertions(+)
 create mode 100644 repository/file

コミットが成功した。初期設定って大事だなぁ。

まとめ

リポジトリをクローンしたらまず自分の情報をgit上で設定しよう。
最低限emailnameは設定しておかないとコミットでこけるから忘れずに。

6
5
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
6
5