【发布时间】:2014-06-20 20:21:39
【问题描述】:
有没有办法将git 全局配置为不自动生成用户的电子邮件,如果没有设置并中止提交?
$ git commit -m "test"
[master (root-commit) 71c3e2e] test
Committer: unknown <my.user@my.very.own.hostname>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
如果提交者没有仔细检查git 警告,这可能会导致严重的隐私泄露。
【问题讨论】:
-
您也许可以创建一个预提交挂钩来检查这一点,并在未配置用户名和电子邮件时让它中止。
-
如果您自己解决问题,请考虑将其作为您自己问题的答案,以便未来的读者可以从该解决方案中受益。或者,考虑关闭和/或删除此问题。由你决定。
标签: git git-commit git-config