在ideal里面突然无法提交代码了
于是使用命令行:
git push;
报错:
写入对象中: 100% (30/30), 3.62 KiB | 928.00 KiB/s, 完成. 总共 30 (差异 13),复用 0 (差异 0) remote: ====================================================================== remote: git log 中发现 yinfuqing@163.com 邮箱不符合要求,请务必使用公司邮箱。 remote: 请再项目下面设置正确 Git 提交信息: remote: remote: git config user.name 'fuqing.yfq' remote: git config user.email 'fuqing.yfq@alibaba-inc.com' remote: git-m remote: remote: 后面一个指令使用了 git-m 命令自动修改 log 信息,获得 git-m 方法: remote: remote: Redhat: remote: sudo yum install git-m -b test -y remote: Windows: remote: 在 msysgit 的命令行中运行: remote: curl http://openbase.cn-hangzhou.oss.aliyun-inc.com/git-m -o git-m remote: Mac OS X : remote: curl http://openbase.cn-hangzhou.oss.aliyun-inc.com/git-m -o /usr/local/bin/git-m remote: chmod 775 /usr/local/bin/git-m remote: remote: 详细参阅: http://baike.corp.taobao.com/index.php/Git-m remote: remote: 如果是开源项目,请联系项目的管理员去掉项目的 Email 验证限制 remote: remote: ======================================================================
方法上面已经写的很清楚了:
先获取权限:
curl http://openbase.cn-hangzhou.oss.aliyun-inc.com/git-m -o /usr/local/bin/git-m
chmod 775 /usr/local/bin/git-m
然后执行:
git config user.name 'fuqing.yfq'
git config user.email 'fuqing.yfq@alibaba-inc.com'
git-m
然后让你输入错误的邮箱:
mz-pms git:(feature/20200603_6740850_mahua_add_venue_1) ✗ git config user.name 'fuqing.yfq' ➜ mz-pms git:(feature/20200603_6740850_mahua_add_venue_1) ✗ git config user.email 'fuqing.yfq@alibaba-inc.com' ➜ mz-pms git:(feature/20200603_6740850_mahua_add_venue_1) ✗ git-m Input the wrong email that you want to fix(yinfuqing@163.com)?yinfuqing@163.com Input the correct username(): fuqing.yfq Input the correct email(): fuqing.yfq@alibaba-inc.com e[1;32mINFO:e[0mI will changed yinfuqing@163.com to fuqing.yfq <fuqing.yfq@alibaba-inc.com> WARNING: git-filter-branch has a glut of gotchas generating mangled history rewrites. Hit Ctrl-C before proceeding to abort, then use an alternative filtering tool such as 'git filter-repo' (https://github.com/newren/git-filter-repo/) instead. See the filter-branch manual page for more details; to squelch this warning, set FILTER_BRANCH_SQUELCH_WARNING=1. Proceeding with filter-branch... Found nothing to rewrite
就可以了