git报错fatal: unable to auto-detect email address (got 'root@web2.(none)')案例

自己创建了一个git服务器,在客户端提交文件时报错:

[root@web2 sample]# git commit -m "add client.txt"

*** 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 'root@web2.(none)')

解决办法:

[root@web2 sample]# git config --global user.name "root"
[root@web2 sample]# git config --global user.email myemail@qq.com

#再次提交就能成功了

[root@web2 sample]# git commit -m "add client.txt"
[master(根提交) 30ea9f9] add client.txt
 1 file changed, 1 insertion(+)
 create mode 100644 client.txt

查看Git系统状态

[root@web2 sample]# git config --list
user.name=root
user.email=myemail@qq.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@201.1.2.100:/data/gitroot/sample.git/
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

[root@web2 sample]# git config user.name 
root

 

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值