In GIT, how can I prevent people from modifying or deleting completed transactions?

We recently had an intern "git reset --hard" and accidentally canceled a lot of work on our main GIT repo. We are in the process of restoring work, but I want to make sure that nothing like this will ever happen again.

I know that there are a lot of questions, but all of them seem to relate to recovery, not prevention. Is there any way to prevent clicking on our main repo that modifies or deletes completed transactions? Is there a configuration setting, or perhaps a pushing hook that will do the job?

+5
source share
1 answer

2 , () , :

receive.denyNonFastForwards
receive.denyDeletes

, . A git reset, a git push, .

, - git push <origin> :<branch-to-delete>, git push , .

+7

All Articles