最近上传测试代码到gitlab远程仓库时,发现提交记录里显示作者名称为unknown,
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200815171207115.png#pic_center
git log -l 检查配置发现配置中无user.name和user.email配置,无该配置时本地 commit时的作者名称是unknow,所以提交到gitlab上也是unknow。

解决方法:
$ git config --global user.name “your name”
$ git config --global user.email “your email@email.com”

配置后git log -l 检查配置是否生效
在这里插入图片描述
看到配置文件里多了name和email表示配置OK。
再push文件到仓库,看看效果:
在这里插入图片描述
在仓库查看提交记录,哈哈哈,问题已解决!

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐