intellij-ideagitlabgit-push

Intellij Gitlab Push rejected


I'm keep getting an error whenever I try to push. How to solve this?

Total 23 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
error: failed to push some refs to 'https://gitlab.corp.test.com/TestTask/generic-concurrent-task-queue.git'
To https://gitlab.corp.test.com/TestTask/generic-concurrent-task-queue.git
!   refs/heads/main:refs/heads/main [remote rejected] (pre-receive hook declined)
Done

Solution

  • The Gitlab repository you are trying to push has the main branch protected. Only certain people can push to protected branches.

    The response from the GitLab server states this.

    remote: GitLab: You are not allowed to push code to protected branches on this project.
    

    If you think you should have access to push check with the admin.

    Ref: Protected branches