Home > Blockchain >  Git: Is there a setting to only allow branch owners to delete their own remote branches?
Git: Is there a setting to only allow branch owners to delete their own remote branches?

Time:10-22

When multiple people collaborate in the same git repository. In order not to delete others' branches by accident. Is there a way to restrict people only allow to delete their own remote branches.

CodePudding user response:

GitHub doesn't provide a way to grant branch-specific permissions in this way, and Git doesn't have the concept of the owner of a branch at all.

If your goal is to prevent users from accidentally deleting others' branches, then you can do that by asking developers to prefix their branches with their username and a slash, which should make it obvious whose is whose.

If you want to have an effective control to prevent users from doing this, then you should use a forking model and have people push to their own forks of the repository instead.

  • Related