问题描述:
用git命令行提交gitee上的代码:
git push -u origin master:master
Bash终端上显示如下:
$ git push -u origin master
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 4.37 KiB | 4.37 MiB/s, done.
Total 13 (delta 7), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.2]
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
To https://gitee.com/xxx/test.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'https://gitee.com/xxx/test.git'
原因分析:
因为在Gitee里设置了不公开邮箱地址,同时禁止了命令行推送暴露个人邮箱,所以导致新项目在push的时候出错:remote: error: GH007: Your push would publish a private email address.
解决方案:
进入Gitee仓库–设置–邮箱管理,去除掉不公开我的邮箱地址。
重新提交命令即可
git push -u origin master:master
成功后显示如下代码
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 4.37 KiB | 4.37 MiB/s, done.
Total 13 (delta 7), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.2]
To https://gitee.com/xxx/test.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.