业务场景:使用git提交readme.txt文件,结果出现如下提示:
[pms@yhd-jqhadoop39 /home/pms/workspace/ouyangyewei/learngit]
$git commit -m 'add readme.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: empty ident name (for <pms@yhd-jqhadoop39.int.yihaodian.com>) not allowed
原因:如上述提示,git未设置用户信息
解决方法:设置user.email和user.name即可
$git config --global user.name "ouyangyewei"
$git config --global user.email "ouyangyewei@yhd.com"
[pms@yhd-jqhadoop39 /home/pms/workspace/ouyangyewei/learngit]$git config --listuser.name=ouyangyeweiuser.email=ouyangyewei@yhd.comcore.repositoryformatversion=0core.filemode=truecore.bare=falsecore.logallrefupdates=true
[pms@yhd-jqhadoop39 /home/pms/workspace/ouyangyewei/learngit]$lsreadme.txt[pms@yhd-jqhadoop39 /home/pms/workspace/ouyangyewei/learngit]$git commit -m 'add readme.txt'[master (root-commit) 3e48caa] add readme.txt 1 file changed, 2 insertions(