自己创建了一个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