【问题标题】:when i write git commit -m "Complete chapter 1" it is not working当我写 git commit -m "Complete chapter 1" 它不工作
【发布时间】:2019-12-01 02:17:03
【问题描述】:
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 以仅在此存储库中设置身份。

致命:无法自动检测电子邮件地址(得到 'Hi@DESKTOP-EL5QS59.(none)')

【问题讨论】:

标签: git git-bash git-commit


【解决方案1】:

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

正如@Amadan 所提到的,它会告诉您错误中的所有内容。您只需要运行以下两个命令:

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

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

更多详情,您可以访问 GitHub 的指南:

【讨论】:

    【解决方案2】:

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

     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
    

    【讨论】:

    • 感谢大家的宝贵时间。现在该命令正在按照您的指示运行。
    • 这是@Saqib上述答案的副本
    猜你喜欢
    • 1970-01-01
    • 2019-12-29
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 2022-10-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多