I need to make a branch protected directly when creating it. I know that I need to go to Settings and set it as protected from there, but what I'm looking for is to set the branch as protected automatically without the need to do that.
GitHub – How to Set Git Branch Protected by Default When Created
automationgithub
Related Topic
- GitHub – How to Remove Upstream from Forked Repository
- Use GitHub pages on multiple repositories when one has a custom CNAME already
- Only receive GitHub email notifications when @mentioned directly
- Modify a GitHub pull request 100% online, without having to install Git
- GitHub – How to Restrict Master Branch/Pull Request Access
- How to synchronise a folder from GitHub repository branch upon commit to a Dropbox directory
- GitHub pull requests: is there a quick way to get to the contributor’s branch
- GitHub – Add to a Pull Request After Source Repo is Deleted
Best Answer
GitHub doesn't have a way to natively enable branch protection for new branches. However, you could set up an automated process using "Update branch protection" from the GitHub API to add branch protection to all new branches.