转载自: 解决remote: error: GH007: Your push would publish a private email address.
因为在gitee里设置了不公开邮箱地址,同时禁止了命令行推送暴露个人邮箱,所以导致新项目在push的时候出错:remote: error: GH007: Your push would publish a private email address.
解决方案(github同理)
继续隐藏私人邮箱
查看当前的git用户名和邮箱
git config user.name
git config user.email
设置邮箱为gitee提供的邮箱地址
git config --global user.email "{ID}+{username}@user.noreply.gitee.com"
重新commit和push
git commit --amend --reset-author
这个命令会打开一个文件让你重新commit,默认情况直接关了就可以。然后再执行:
git push
即可。
公开邮箱
取消设置里的隐藏邮箱就可以了。。。
参考
StackOverflow - Error “Your push would publish a private email address”
CSDN - remote: error: GH007: Your push would publish a private email address.