解决gitte提交报错 error: GE007: Your push would publish a private email address.

76 阅读1分钟
错误情况: gitte提交报错,无法提交上去,报错如下:
remote: Powered by GITEE.COM [GNK-6.0]
remote: error: GE007: Your push would publish a private email address.        
remote: You can make your email public or disable this protection by visiting:        
remote: https://gitee.com/profile/emails
remote: error: hook declined to update refs/heads/master        
error: failed to push some refs to 'https://gitee.com/ck_567/leet-code-practice.git'
To https://gitee.com/ck_567/leet-code-practice.git
!	refs/heads/master:refs/heads/master	[remote rejected] (hook declined)
Done

image.png

原因:因为在gitee里设置了不公开邮箱地址,同时禁止了命令行推送暴露个人邮箱 解决:需要设置gitte上找到允许推送的邮箱地址,然后设置在本地的git环境变量中。 在gitte设置中找到邮箱管理,如下:

image.png

image.png

image.png

将提交邮箱设置这里的邮箱拿出来设置到你本地,如下:

设置你的提交邮箱

git config --global user.email 3784276328_wsnbb@user.noreply.gitee.com

查看全部变量

git config -l