Changing commit metadata on all commits

This question already has an answer here:

  • Change the author and committer name and e-mail of multiple commits in Git 29 answers

  • You can use git filter-branch like (modify "New Name" and "new@email.com"):

    git filter-branch --commit-filter 'export GIT_AUTHOR_NAME="New Name"; export GIT_AUTHOR_EMAIL="new@email.com"; git commit-tree "$@"'
    

    If you do not want to do the whole branch you can add a revision range at the end (reva will not be touched):

    git filter-branch --commit-filter 'export GIT_AUTHOR_NAME="New Name"; export GIT_AUTHOR_EMAIL="new@email.com"; git commit-tree "$@"' reva..revb
    
    链接地址: http://www.djcxy.com/p/28494.html

    上一篇: 更改Git提交消息

    下一篇: 更改所有提交的提交元数据