DEV Community

Discussion on: Why committing straight to main/master must be allowed

Collapse
 
190245 profile image
Dave

We use a hybrid approach.

Standard features, worked on in isolation, are done in feature branches, that are then subject to pull request & relevant review.

Emergency hotfixes, are always done by at least two people looking at the problem, so they have in effect been reviewed while being developed, and things are already on fire - so this is both time critical and we're not likely to make it worse - so they go direct to main.

But also, your seniority level (as a proxy for trust) defines what you can do - a junior that's only worked with us for a week won't be committing to main or bypassing anything. A senior developer (or above) can write direct to main, while management tiers can push things to Production without it even being in git.