Prevent your main branch from dangerous changes

Enable a main branch protection by allowing pushing to main branch only to project leader. Also disable the possibility by rewriting the history.


version control, git, branch protection

Main branch protection should prevent losing code or breaking the project building.


concret: specific best practice (e.g. use microservice)

Application domain:
Software engineering

Main phase:
Development: Implementation/Code/Build

Related literature:
Benvegnù, D. (2020, November 10). Best Practices for Branch Protection. DEV Community 👩‍💻👨‍💻.

In which projects do/did you use this practice?

Full-stack Developer

3–5 years of experiences
Masaryk University

1. How do ​you rate the potential benefit for your projects? 5
2. How often are you using that practice? 5
3. What is the effort to introduce the practice in your project upfront? 1
4. What is the effort to apply the best practice in your project daily basis? 1

Questions 1, 3 and 4 (1 = Low, 5 = High)
Question 2 (1 = Never, 5 = Always)

You are running an old browser version. We recommend updating your browser to its latest version.

More info