How to find out who delete a branch at git? [duplicate]

末鹿安然 提交于 2019-12-21 23:54:02

问题


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?

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


回答1:


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.

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

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

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.



来源:https://stackoverflow.com/questions/18010392/how-to-find-out-who-delete-a-branch-at-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!