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。
再度コミットしてみると上手くいきました!良かった~♪
最後に
初めて記事を書いてみました。
これからも自分が困って調査したことを書いてみようかな。
頑張れ新人エンジニアの自分。