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".