解决 GitLab: You are not allowed to force push code to a protected branch on this project问题

When we sometimes roll back the code and want to force push to the remote warehouse,

git push origin --force

The following error will be reported:

You are not allowed to force push code to a protected branch on this project

If you are using the gitlab version library, it means that gitlab has enabled protection for the warehouse and needs to be set in the warehouse:

"Settings" -> "Repository" -> scroll down to "Protected branches".

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324214252&siteId=291194637
Recommended