如何从git存储库中删除我的电子邮件

时间:2011-11-01 09:09:10

标签: git

我想在github上发布现有的git存储库。我发现没有必要在git提交日志(名称,电子邮件)中提供个人数据。不过,我想存储变化的历史。

如何从现有的完全可访问的git存储库中删除/替换个人信息?

2 个答案:

答案 0 :(得分:0)

您应该使用git filter-branch。对于脚本示例,请检查此答案Change the author and committer name and e-mail of multiple commits in Git

答案 1 :(得分:0)

要删除日志消息中的个人详细信息,您可以将git filter-branch--msg-filter标记一起使用。

--msg-filter <command>
       This is the filter for rewriting the commit messages. The argument
       is evaluated in the shell with the original commit message on
       standard input; its standard output is used as the new commit
       message.

PS:您在Github(https://github.com/account)公开个人资料中的电子邮件地址仅向访问您个人资料的人员显示。您在提交中使用的用于识别提交的电子邮件地址(https://github.com/account/email)不会向公众披露