Why Reject Force Push option to master branch not working

Hi,

We are evalulating the plugin  "Force Field" version 1.2.1 on Bitbucket Server 3.11.2.

 

I configured the hook for a test repository and enabled it. Under "Reject Force Push to Branch" I set the value of 

Hook did not blocked the force push. Did I do something wrong?

Could you please guide? Thanks.

Best Regards,

Praveen

2 answers

1 accepted

1 vote

If you are using Bitbucket Server 3.10 or higher, Bitbucket Server's built-in branch permissions will let you do the equivalent of the "Force Field" hook. 
You can set up a permission on the branch and tick the "Prevent rewriting history" checkbox. 

Note that this will only reject commits that actually rewrite the history. Doing a git push --force on a branch that can be fast forwarded will not be rejected. (As in that case the --force option is redundant)

It will also prevent pushing rebases of the branch. 

I hope this helps, 

Felix Haehnel

 

 

Haven't used Force field plugin yet, but stash comes with a Reject Force Push , if you enable that it works fine for sure. Only difference is you cant select the branches that you want this to be applied to. Other work around would be to use the branch permissions in stash to prevent push to master(again that is push to master in general and not push --force)

Thanks. Your input helped.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

170 views 6 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you