【git】本地仓库第一次提交操作时报错-- Author identity unknown

 

ps:

windows系统,已安装git ,已创建一个本地仓库(git init 仓库路径)

 

error:

本地仓库第一次提交操作时报错-- Author identity unknown

 

solution:

依次执行以下指令,再重新提交即可

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

 

record:

C:\Users\asus>D:

D:\>cd D:\Git\tmp\practice

D:\Git\tmp\practice>git add 2.txt

D:\Git\tmp\practice>git add 3.txt

D:\Git\tmp\practice>git add 1.txt

D:\Git\tmp\practice>git commit -m "add all files into repository"
Author identity unknown

*** 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: unable to auto-detect email address (got 'asus@DESKTOP-T5PF78H.(none)')


D:\Git\tmp\practice>git config --global user.name "cc"

D:\Git\tmp\practice>git config --global user.email "2397636949@qq.com"

D:\Git\tmp\practice>git commit -m "add all files into repository"
[master (root-commit) 91c210a] add all files into repository
 3 files changed, 3 insertions(+)
 create mode 100644 1.txt
 create mode 100644 2.txt
 create mode 100644 3.txt

 

posted @ 2021-05-13 11:49  bigorangecc  阅读(2590)  评论(0编辑  收藏  举报