git - 当我写 git commit -m "Complete chapter 1" 它不工作
问题描述
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 中配置您的详细信息。
正如@Amadan 提到的,它告诉您错误中的所有内容。您只需要运行以下两个命令:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
替换your@example.com
为您的电子邮件和Your Name
您的姓名并运行这些命令。您将能够提交更改。
有关更多详细信息,您可以访问 GitHub 的指南:
推荐阅读
- c# - 使用 PreserveReferencesHandling 和过时属性反序列化为 Null 的 Json 对象
- java - Java Stream 读写不能同时工作
- ms-access - 是否可以在 MS Access 中安排每日宏的执行?
- python - TypeError: 'dict' 对象在使用 request.json() 时不可调用
- perl - 共享数据的长度超过共享段大小-在 perl 代码中出现此错误
- flutter - 在颤动的一个地方检查http响应的好模式是什么?
- scala - 十进制值的密集等级
- java - 带有 2 个主文件的 liquibase 配置 - 可以吗?
- ios - 在swift ui xcode 11.5中填充给定条件的列表
- unity3d - 楼梯上有航点,可以让物体在楼梯上上下移动,但楼梯也有导航网格障碍物组件,我该怎么办?