我怎样才能找出谁强行推入git?

时间:2013-02-22 16:02:37

标签: git

有人使用git push --force,但我不知道是谁从日志中做到了。有没有办法找出罪魁祸首?

2 个答案:

答案 0 :(得分:56)

2018年11月更新:如果您要推送集中式Git存储库托管服务,例如GitHub,然后,您将能够看到谁强行推送您的分支机构。但只是因为GitHub选择在其GUI中显示该事件。

https://pbs.twimg.com/media/DsJIVxtU4AAreMW.jpg:large

点击“Find committer of a force push on GitHub”了解更多信息。


2013年原始答案:

正如我在“Distributed Version Control Systems and the Enterprise - a Good mix?”中提到的那样,单独使用Git没有授权或身份验证。

您需要authorization layer之类Gitolite来跟踪谁做了什么。 (Gitolite有自己的审计跟踪机制)。

但是如果您的回购可以通过file (or local) protocol访问,那么您无法知道是谁强行推送。

polygraph (来自motivationalgenerator.comwikipedia

答案 1 :(得分:0)

如果您幸运足以使用GitHubGitHub for Enterprise,您可以查看events REST API并查看谁/何时推送/删除到远程引用,例如log4j:

  

https://api.github.com/repos/apache/log4j/events

相关问题