目标:锁定main分支不允许push,如果要push请另外拉取分支。 操作:选择settings-branches-填写protected branch name-选择 locked branch 设置完成后效果如图: