您可以使用git filter-branch
您的目的;具體而言,其env-filter
。
--env-filter <command>
This filter may be used if you only need to modify the environment in which
the commit will be performed. Specifically, you might want to rewrite
the author/committer name/email/time environment variables (see
git-commit-tree(1) for details). Do not forget to re-export the variables.
喜歡的東西:
git filter-branch \
--env-filter 'export GIT_AUTHOR_NAME="First Last";
export GIT_AUTHOR_EMAIL="[email protected]";
export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME}";
export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL}";' \
-- --all
如果你不需要改變你的作者姓名,只是下降的GIT_AUTHOR_NAME
和GIT_COMMITTER_NAME
assigments。
棒極了!謝謝! – dghubble