How can you stop a branch being accidentally deleted in a pull request?
The issue is the "Complete pull request" has got the "Delete dev after merging" check box, and this seems to be checked by default, which may be because I'm the owner of the repos.
Is there someway to disable this for all users?
答案 0 :(得分:6)
目前,在合并选项后无法禁用删除源分支。
并且有一个用户语音Disable Delete Branch Checkbox in PR When Branch Policy In Place,其中包含类似功能,您可以投票和跟进。
解决方法是为您的情况设置目标分支(dev
分支)的分支安全性:
在VSTS分支标签中 - >点击…
分支的dev
按钮 - >分行安全 - >更改强制推送(重写历史记录,删除分支和标签)为用户和组拒绝 - >保存更改。
BTW:默认情况下,未选中/选择PR完成窗口中的合并选项后删除源分支,但是基于上次设置。例如,如果您现在取消选择该选项,则下次打开PR完成窗口时,将取消选择合并后删除源分支选项。
答案 1 :(得分:0)