mail address in every commit message

This question already has an answer here:

  • Accidentally pushed commit: change git commit message 4 answers
  • Change the author and committer name and e-mail of multiple commits in Git 29 answers
  • git change all history for committers names and email for specific committer 1 answer

  • You will need to use filter-branch

    git filter-branch --commit-filter '
            if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ];
            then
                    GIT_COMMITTER_NAME="<New Name>";
                    GIT_AUTHOR_NAME="<New Name>";
                    GIT_COMMITTER_EMAIL="<New Email>";
                    GIT_AUTHOR_EMAIL="<New Email>";
                    git commit-tree "$@";
            else
                    git commit-tree "$@";
            fi' HEAD `
    

    If you are the ONLY user who committed to this repository you can simply update all references without checking the old content

    git filter-branch -f --env-filter '
        GIT_AUTHOR_NAME="Newname"
        GIT_AUTHOR_EMAIL="newemail"
        GIT_COMMITTER_NAME="Newname"
        GIT_COMMITTER_EMAIL="newemail"
      ' HEAD
    
    链接地址: http://www.djcxy.com/p/28504.html

    上一篇: 如何将捐款捐赠给另一个帐户的github?

    下一篇: 邮件地址在每个提交消息中