在 svn 到 git 迁移期间提交作者有错误的电子邮件
During svn to git migration commit authors have wrong email
我已将我的 svn 存储库迁移到本地 git。出于某种原因,所有作者看起来都像:
userid <userid@localhost>
有没有办法把所有作者重写"localhost"改成"myorg.org"
userid <userid@myorg.org>
更新
userid 不固定。
评论提供了一些在导入过程中修复此问题的建议。如果您想在导入完成后修复它,您可以使用git filter-branch
命令重写作者电子邮件。
git filter-branch --env-filter '
GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL/localhost/myorg.org}
GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL/localhost/myorg.org}
'
这将在所有作者和提交者电子邮件(在当前分支上)中用 myorg.org
代替 localhost
。
我已将我的 svn 存储库迁移到本地 git。出于某种原因,所有作者看起来都像:
userid <userid@localhost>
有没有办法把所有作者重写"localhost"改成"myorg.org"
userid <userid@myorg.org>
更新
userid 不固定。
评论提供了一些在导入过程中修复此问题的建议。如果您想在导入完成后修复它,您可以使用git filter-branch
命令重写作者电子邮件。
git filter-branch --env-filter '
GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL/localhost/myorg.org}
GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL/localhost/myorg.org}
'
这将在所有作者和提交者电子邮件(在当前分支上)中用 myorg.org
代替 localhost
。