Branch-specific Push Rules
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=32108)
</details>
<!--IssueSummary end-->
### Problem to solve
Apply push rules to specific branches.
### Intended users
* [Parker (Product Manager)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#parker-product-manager)
* [Sasha (Software Developer)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#sasha-software-developer)
### Further details
As a developer, I can push commit messages to certain branches under one (more relaxed) set of rules. But, when I commit to other branches, like integration branches (`master`, or ones I specify), my commit messages will be examined against a different set of rules.
Branch-specific rules would allow me to move quickly on my feature branches, but apply rigidity to the important `master` branch.
### Proposal
My guess is that this would involve quite a bit of effort. It could be done a couple of ways:
- making the interface for current push rules (probably not all of them, just ones that make sense for specific brances) take a branch name and allow you to create a set of rules below it. From a UI perspective this would look a lot like how one creates Deploy tokens or adds branch protections.
- allowing the customer to build [pre-receive hoooks similar to GitHub](https://github.com/github/platform-samples/tree/master/pre-receive-hooks), but on gitlab.com, and of course in a safe way. (you can already do this if you run your own servers)
### Links / references
- Salesforce
- https://gitlab.my.salesforce.com/0016100001TCxI2
- https://gitlab.my.salesforce.com/0016100000UL5PBAA1
- Zendesk
- https://gitlab.zendesk.com/agent/tickets/110219
- https://gitlab.zendesk.com/agent/tickets/15244
- https://gitlab.zendesk.com/agent/tickets/84134
- https://gitlab.zendesk.com/agent/tickets/196512
- Forum
- https://forum.gitlab.com/t/push-rules/24993
- https://forum.gitlab.com/t/push-rule-for-specific-branch-es-only/24890
issue