如何找出谁删除了git分支? [英] How to find out who delete a branch at git?

查看:2703
本文介绍了如何找出谁删除了git分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在与git仓库一起工作的团队中工作。我们有一个起源和几个本地副本。每个人都通过不同的方式与起源进行交互:从Unix,从Windows,Unix,Windows Shell,NetBeans,PHPStorm。碰巧有人删除了几个本地和远程分支。我们已经还原了它们。

I work at the team which works with git repository. We have an origin and several local copies. Everybody interacts with origin by different means: from Unix, from Windows, Unix shell, Windows shell, NetBeans, PHPStorm. It happens that somebody deleted several local and remote branches. We already restored them.

但是如何找到对此负责的人呢?

But how to find the person who is responsible for it?

我检查了 git reflog ,但在那里看不到任何可疑的东西。

I checked git reflog, but can't see anything suspicious there.

推荐答案

Git不会保留对回购操作的审核跟踪。

另外,它没有任何身份验证机制,因此它不知道做了什么。

Git doesn't keep an audit trail of the operations done to a repo.
Plus it doesn't have any authentication mechanism, so it doesn't know who did what.

要跟踪(谁做了什么),您需要添加到中心回购授权层,例如 gitolite

To keep track of that (who did what), you need to add to your central a repo an authorization layer like gitolite.

这假定您通过以下身份验证机制与中央存储库进行通信:

That assumes you communicate with your central repo through an authentication mechanism like:


  • Apache

  • SSH

(使用共享路径或git url不会包含gitolite验证/授权git命令所需的身份验证ID)

(using a shared path or git url wouldn't include the authentication id that gitolite needs to validate/authorize the git command)

,因为gitolite会根据谁验证每个git命令您的位置很独特,可以保持您要进行的审计跟踪(谁做了什么)。

The idea is that, since gitolite validate every git commands based on who you are, it is in a unique position to keep the kind of audit trail (who did what) you are after.

这篇关于如何找出谁删除了git分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆