2
1

git commit を実行したら「Author identity unknown」のエラーが出たときの対処法

Last updated at Posted at 2024-03-16

git commit を実行したら「Author identity unknown」と怒られた時の対処法

はじめに

Gitをインストールした!コミットまでしてみよう!の段階でエラーが...。
無事に対処できたので未来の自分のためにメモとして残しておいてあげます。
あくまで自分用ですが誰かの参考になればちょっとだけ嬉しいかも。

実行文

git commit -m "add new file"

エラー文

Author identity unknown

*** 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.
エラーの意味はこんな感じ

あなたは誰ですか?
メールアドレスとユーザーネームを設定してね。

対処法

上記のように聞かれているため、以下のコマンドを実行!

git config --global user.email "メールアドレス"
git config --global user.name "ユーザーネーム"

git config コマンドを使用してメールアドレスとユーザーネームを設定しています。

これでOK。
再度コミットしてみると上手くいきました!良かった~♪

最後に

初めて記事を書いてみました。
これからも自分が困って調査したことを書いてみようかな。
頑張れ新人エンジニアの自分。

2
1
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
2
1