当我写 git commit -m "Complete chapter 1" 它不工作

when i write git commit -m "Complete chapter 1" it is not working

cd Desktop
mkdir Story
cd Story
touch chapter1.txt
atom .
git init
git add chapter1.txt
git status
git commit -m "complete chapter 1"

它向我显示此错误消息:

***请告诉我你是谁。

运行

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

设置您帐户的默认身份。

省略 --global 以仅在此存储库中设置身份。

fatal: unable to auto-detect email address (got 'Hi@DESKTOP-EL5QS59.(none)')

git 需要知道提交更改的用户的信息。此消息表明您尚未在 git 中配置您的详细信息。

正如@Amadan 提到的,它在错误中告诉你一切。您只需要 运行 以下两个命令:

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

your@example.com 替换为您的电子邮件,将 Your Name 替换为您的姓名和 运行 这些命令。您将能够提交更改。

有关详细信息,您可以通过 GitHub 访问指南:

您需要运行执行一次以下命令。

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

 git config --list    # see if the 'name' & 'email' are set correctly