Git に Please tell me who you are と聞かれたとき

投稿者: | 2020年1月9日

コマンドラインからGitを使ってリモートからpullしようとしたら、下記のようなエラーが出ることがあります。

*** 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 <***>) not allowed
From bitbucket.org:***/***
* branch            develop    -> FETCH_HEAD

これはアクセスが許可されているユーザーか判別できないため、発生するそうです。というわけで下記のようにリモートリポジトリに登録してある自分のメールアドレスとユーザー名を設定します。

git config user.email "tsuno@example.com"
git config user.name "tsuno"

その後、再びエラーが発生したコマンドを実行すれば、正常に動作するはずです。