From 82d4db828828855a7aeaf4400a2c017a275766d3 Mon Sep 17 00:00:00 2001 From: Ben Greeley Date: Fri, 8 Mar 2019 16:43:23 -0500 Subject: [PATCH] Add protecting the master branch to engineering best practices --- _includes/markdown/Version-Control.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_includes/markdown/Version-Control.md b/_includes/markdown/Version-Control.md index 51ecd3bd..0121633c 100644 --- a/_includes/markdown/Version-Control.md +++ b/_includes/markdown/Version-Control.md @@ -53,6 +53,13 @@ git commit In order to avoid large merge conflicts, merges should occur early and often. Do not wait until a feature is complete to merge ```master``` into it. Merging should be done as non-fast-forwards (`--no-ff`) to ensure a record of the merge exists. +### Protecting the ```master``` Branch + +We recommend for all repositories to be configured so the ```master``` branch is protected to prevent direct pushes. All merges should be made through a pull request, which ensures all code changes are peer reviewed before merging to prevent unintentional code reversions. Additionally, protecting branches provides the following benefits: + +* Prevents the master branch from being accidentally deleted by other engineers +* Prevents force-pushes to the branch, overwriting the history + ### Themes All new development should take place on feature branches that branch off ```master```. When a new feature or bugfix is complete, we will do a non-fast-forward merge from that branch to ```staging``` to verify the feature or fix on the stage environment.