Hello,
is there a way to prevent an accidental deletion of a branch, e.g. when merging a Pull Request and someone clicks on "Delete source branch on merge"?
It is about Bitbucket Cloud.
Thank you
Hi Jaroslav,
Can you check Tim's solution ,it will do the following :
Thanks
Adel
Unfortunately, Tim's solution is for Bitbucket Server.
For Bitbucket Cloud, however, you can use branch permissions to prevent users from deleting the branch in question.
Hello Tom,
there is a new option under custom settings: "Deleting this branch is not allowed"
I swear two days ago it wasn't there :-)
Thanks a lot!
I'm not seeing an option to prevent deletion of master or a branch "type" (like Development)...
https://i.imgur.com/75VVQab.png
It's very easy in a git GUI or CLI to accidentally select to delete the remote branch or mistype an option.
I'm not sure a plugin is feasible without knowing exactly what it's seeing or doing in its code execution (privacy & security issue), and also an incompatibility or update can cause disruption if we're relying on it.
Just a thought/idea, you may want to solve this problem at a lower layer, in `git` you can use an update-hook and simply prevent the deletion. This should live with the repo and protect it where it sits Bitbucket cloud or server.
https://stackoverflow.com/a/6827045
Hooks are not included in pushes or pulls, though, and users do not have direct filesystem access to the .git directory in a repo on Bitbucket Cloud.
@jredmondfair enough. I also assumed users could edit repos in Bitbucket Cloud.
There's a bug in Jira! If no user is on the write access field you won't see the options to prevent the branch to be deleted. Add a user, check/uncheck the option, remove the user and save.
It looks like you're new here. Sign in or register to get started.