LoginSignup
1
1

More than 3 years have passed since last update.

初回のgit initしたときのエラー(解決済)

Posted at

起きたエラー

GitHubでレポジトリを作成後、初回コミットとして以下のコマンドを実行した。

git branch
echo "# project名" >> README.md
git init
git add README.md
git commit -m "first 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: empty ident name (for project) not allowed

解決方法

まだまだ、黒い画面での作業に抵抗あり、あたふたしていましたが、
冷静に読んでみると、ヒントがありました。

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

gitは、私が誰だかわかっていなかったようで、
ヒントのとおり、自分のメールアドレスとユーザー名をコマンドたたく。

その後、再び、初回のinitのコマンドを実行したら問題なく初回コミットができました。

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