Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Branch restrictions setup

jang shin February 14, 2024

I want to protect the main branch from NoMerge_* branches, and set the branch restrictions.

Here's what I expect:

Merging from 'NoMerge_*' to 'main' : Blocked

Merging from 'main' to 'NoMergw_* : allowed.

 

However, I was able to merge 'NoMerge_TPR20681' into 'main'.

$ git merge NoMerge_TPR20681
Updating 4aa9c40..bada640
Fast-forward
sst20604 | 8 ++++----
sst20681 | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
$ git branch
NoMerge_TPR20681
* main
$

How can I configure Git to block merges from any 'NoMerge_*' branches into 'main'?

branchrestrictionset.png

1 answer

1 accepted

0 votes
Answer accepted
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2024

Hi @jang shin ,

Branch restrictions are based only on *destination*. So instead of protecting 'NoMerge_*' you need to protect 'main'.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events