GIT: How to protect the branch from being removed by other developers?

后端 未结 5 1940
情歌与酒
情歌与酒 2021-02-19 20:29

After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such

5条回答
  •  感情败类
    2021-02-19 21:25

    There are many ways to tackle this:

    1. Make another repo that's a sand box, and give readonly access to the master one. If they delete by accident they can get the branch from the master repo. This assumes you are only using github for your repos aside the local dev repos.
    2. Setup hooks in the repository that don't allow branches to be deleted unless you are a specific user. You can't do that on github as they won't allow arbitrary code to be executed on their servers. If you get a local repo instead, you can do this.
    3. Setup a local gitolite install to manage branches with permissions.

提交回复
热议问题