gitgitlab

When pushing for the first time to Gitlab get ! [remote rejected] development -> development (pre-receive hook declined)


I'm trying to start working with GitLab for the first time. I created a new repo locally and tried to push that to GitLab. What I get is:

! [remote rejected] development -> development (pre-receive hook declined)

I know that by default master/main branch is protected so I (with a developer role) can't push there. That's why I from the even beginning created the developer branch. I even do not have the main branch locally at all, here is git branch output:

* development

So I'm definitely not trying to push into the main. But I still get this error. Could you please provide any ideas on how I should handle that?


Solution

  • Actually, the thing was in permissions. As I understand - if your role is developer and repo is empty (that means no main/master branch), than yau have no ability to up in it an initial commit as it means that you also push main/master there. So if you face this problem - ask somebody who maintain repo to increase your permissions temporarily for the time of first push