问题
在git push时,错误提示如下:
remote: GitLab: You are not allowed to force push code to a protected branch on this project.To git@xxx:xxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: 无法推送一些引用到 'git@xxx:xxx.git'
关键内容就是protected branch,所以我们需要确认是怎么protected。
解决
repo->settings->repository->protected branches: