We recently decided, for safety reasons and ensuring solid reviews, protecting our master branches in GitHub was something we should be doing. Having looked into it, a few quick clicks later our core repositories were done. The challenge came down the line when we needed to easily turn them all on. With >100 repositories that would be somewhat of an arduous point and click task so I knocked up a crude and basic script to do it for me.
For reference a few pages on GitHub’s site are useful:
It should be noted that in the API documentation it states that protected branch API calls are in Developer Preview so you’ll notice the extra part from the docs to enable this:
About the Author
Ian Winter is Head of Technical Operations for Venntro. He
manages a team of four engineers who provide 24/7/365 support and are
responsible for over 120 physical, virtual, storage and network devices.