LoginSignup
147
110

More than 5 years have passed since last update.

gitで起きたエラーの解決法

Last updated at Posted at 2017-02-05

今回起こったこと

railsチュートリアルをやっている最中にgit commitしようとしたら
思わぬエラーが発生した。

*** 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: unable to auto-detect email address (got '○@○Air2.(none)')

要はあなたは誰ですか状態だったらしい。
gitの初期設定ができてないみたい。。(以前に何回かcommitしてるのだが。。。)

解決策

エラー文を見れば分かる通り、gitに自分を分からせるために
gitに登録しているアドレスと、ユーザーネームを指定してあげればいい。
ターミナルで以下を実行

$git config --global user.email ここに自分のアドレス
$git config --global user.name ここに自分の名前

アドレスと名前の部分は""が無くても大丈夫みたい。

とりあえずこれで再度pushしてみると
いけました!!!

147
110
1

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
147
110