问题描述:

当输入:

git commit -m "Add new"

企图commit change,然后push到GitHub上的时候,出现以上报错。

问题原因以及解决办法:

Git还没有识别出本地的仓库用户名,需要再手动输入一遍设置:

注意,两部分都要输入,要不然还是识别不了

第一部分:邮箱(你的Github邮箱)

#引号部分,需要输入你注册Github的邮箱
git config --global user.email "you@example.com"

第二部分:你的Github用户名(Github Username)

# 引号部分输入你的Github账户用户名
git config --global user.name "Your Name"

输入完成后,再次执行命令Commit:

git commit -m "Add test file"

再次查询Git状态,确认Commit都已成功:

git status

出现以下部分,则证明成功:

接下来则可以正常push

Git push origin "your branch"

问题解决/

如果对您有用,还请点个赞~

Logo

一站式 AI 云服务平台

更多推荐