I was wondering whether there was a way to reject force push on the master branch only.
This is so developers can work on feature branches, push, rebase & force push as necessary before a code reviewer merges into master.
I believe this has finally been added in Stash 3.10 :
https://confluence.atlassian.com/display/STASH/Stash+3.10+release+notes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is some further documentation: https://confluence.atlassian.com/bitbucketserver/using-branch-permissions-776639807.html#Usingbranchpermissions-Addingbranchpermissions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
I'm afraid there isn't really a way at the moment. You could certainly add your own custom plugin to do just that. Otherwise you might be interested in this feature reques, which you should vote on:
https://jira.atlassian.com/browse/STASH-2905
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the quick response! I guess a custom plugin might be the way to go. Do you know if the code is hosted somewhere?
I found this (https://bitbucket.org/mark0815/stash-reject-force-push-hook) but I don't think that's the one used in Stash?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
I'm afraid our code is currently private, although honestly it looks almost identical to out code _plus_ it has a branch selector. That would be a good starting point, and if you just want one branch to restrict then it should probably work out of the box.
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh cool - sorry I only just had a moment to look at the code - thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://bitbucket.org/mark0815/stash-reject-force-push-hookwas deleted back in April. Anyone know why, or if there is a replacement? I still have a copy of it locally, will republish if needed. (Though I suspect it might be broken on Stash 3.1 ... still investigating that.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rally nice plugin Carolyn!! We tried it and it works nicely! You shoud add the link as an answer to this question instead of just a comment, it may be easily missed otherwise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.