Set up merge rules
Set the rules for merging branches.
Read time 1 minuteLast updated 21 days ago
Edit the
mergerules.confserver
The mergerules.conf file is a JSON file that contains your merge rules. To add a merge rule, you need to place the rule inside an array:
You can use the following parameters to define your merge rules:[{ "enabled": true, "repositories": "code*", "rule": "only_allow_merges_if_reviewed", "to": { "branchNames": ["main"], "branchesWithAttribute": [ { "attribute": "merge_only_reviewed", "value": "enabled" } ] }, "from": { "branchNames": ["scm*"], "branchesWithAttribute": [ { "attribute": "task", } ] }}]
Parameter | Description |
|---|---|
| Enter |
| Use patterns to match any repositories you want the merge rule to apply to. |
| Specify the merge rule to use. To find the available merge rules, refer to the page on types of merge rules. |
| Specify any destination branches you want to apply the merge rule to. |
| Specify any source branches you want to apply the merge rule to. |
tofromParameter | Description |
|---|---|
| Use this key to specify the branch names or that you want to apply the merge rule to. Use an |
| Use this key to filter branches by attribute. Specify the |
| If you filter branches by attribute, use this key to specify which attribute to use. |
| If you filter branches by attribute, you can specify a value for the attribute. |