修改git全部已提交的用户名和邮箱
随风飘扬 学习 2018年08月18日14:25 2169
原文的link:http://dangzhiqiang.blog.51cto.com/7961271
原文的link:http://dangzhiqiang.blog.51cto.com/7961271/1657864
虎zj泰du克hb新vk闻hve网a版权所有,请勿未授权转载!!!
虎ly泰xdzxk克ueb新og闻vfp网hl版权所有,请勿未授权转载!!!
改变作者信息
使用脚本改变你 repo 的 Git 历史
欲修改的旧的邮箱地址
正确的用户名和邮箱地址
#!/bin/sh git filter-branch --env-filter ' OLD_EMAIL="your-old-email@example.com" CORRECT_NAME="Your Correct Name" CORRECT_EMAIL="your-correct-email@example.com" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags
虎gtp泰_a克jcfoa新o闻vhuv网mc版权所有,请勿未授权转载!!!
注:当执行完上述的命令后,发现新clone出来的历史记录中name和email信息已经为最新的信息;可是在执行上面的脚步之前已经clone出来的项目,如果执行git pull的话,历史记录中的name和email信息还是原来的信息
虎mo泰v_o克wgtd新p闻tmow网l版权所有,请勿未授权转载!!!
Statement: all articles / drawings reproduced on this website are for the purpose of transmitting more information and facilitating discussion, which does not mean that the website, the host and the organizer agree with their opinions or confirm the authenticity of their contents. The contents of the articles are for reference only. If the rights of the original author are violated, please contact the website administrator.
Comment list
-
No data