The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Saxea _Flowie_
Atlassian Partner
February 14, 2024

Hi @jang shin ,

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

 

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events