背景
在新电脑上推送时出现这个邮件地址提示。
解决方法
- 简单的方法是直接把 .gitconfig这个文件中的 用户名和地址都改掉,改为网站提供的保密邮件地址。
- 如果涉及到 github 和 gitee 等多仓库使用的情况,建议设置 仓库级别的 用户名和地址。保存到了 .git/config中去了。
git config --local user.name "username"
git config --local user.email user@email.com
- 然后,使用新的用户名和地址 重做 commit , git commit --amend --reset-author
- 最后,重新推送即可。
参考
解决remote: error: GH007: Your push would publish a private email address.
https://blog.csdn.net/weixin_49393427/article/details/113832288
Git配置多用户和邮箱
https://blog.csdn.net/U_riel/article/details/102727018
 
                     
                    
                 
                    
                 
 
         
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号