我使用git svn将Subversion存储库转换为Git,但遗憾的是现在只注意到一些作者信息是错误的.转换后的存储库尚未与任何人共享,因此我想重写其中的提交日志 - 如果可能的话.
如何重写git存储库,以便所有提交的日志显示,例如
Author: John Doe <john.doe@example.com>
Run Code Online (Sandbox Code Playgroud)
代替
Author: John Do <john.do@example.com>
Run Code Online (Sandbox Code Playgroud)
我自己尝试这样做,似乎git-filter-branch是我需要的.不过,我无法做到这一点.
bdu*_*kes 19
$ git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "schacon@localhost" ];
then
GIT_AUTHOR_NAME="Scott Chacon";
GIT_AUTHOR_EMAIL="schacon@example.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
Run Code Online (Sandbox Code Playgroud)