Reputation: 3
I'm working on a project with a team which consists of 40 persons, where each group works on a feature. I thought that each group works on a branch.
The problem is that it is possible that by mistake people push to master instead of pushing to their branch before finishing the feature.. thus damaging the master branch..
Is there a way to prevent this?
Upvotes: 0
Views: 234
Reputation: 36765
You cant lock single branches*. Instead, you should prevent pushing to the main-repostory for everyone except you.
Each team should not have just a branch but an entire remote repository (with as many branches as they like) to wich only members of each group can push to (but everyone can pull from). Once a feature is ready to be merged, they should send you an email and ask you to pull and merge it into main.
You can also go a step further and give each member their own remote repository. Each member then will send an email to their group leader asking for a pull. This is effectively the pull-request-model they're also using on GitHub and also the model they're using for the Linux Kernel.
Upvotes: 3