GitLab - Master [remote rejected]: You are not allowed to push code to protected branches

By xngo on February 21, 2019

Issue

GitLab: Master [remote rejected]: 
 
pre-receive hook declined
GitLab: You are not allowed to push code to protected branches on this project.

Solution

Before GitLab 9.0

  1. From Gitlab.com, open your project.
  2. Click on the "gear" icon and then select Protected Branches.
  3. Click on Unprotect.

Gitlab -protected branches before version 9

After GitLab 9.0

  1. From Gitlab.com, open your project.
  2. Navigate to Settings > Repository.
  3. Click on Expand under Protected branches.
  4. Click on Unprotect.

Gitlab - Path to protected branches

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.