How to create a default branch in GitLab?

Viewed 11984

I am not able to push code to GitLab for the first time.

I have created a Gitlab project on the web interface.
I have created an ASP MVC project.
I did "git init" in that directory.
I added remote origin.
I added and committed the changes and then, when I want to push the changes to remote I get the following error:

remote: A default branch (e.g. master) does not yet exist for
...
remote: Ask a project Owner or Maintainer to create a default branch:
...
error: failed to push some refs to

So I want to know if I can create a branch with the role Developer?
If yes how to create a default branch?
If no, what should my next steps be?

1 Answers

This is followed by issue 54155

It seems as though 'developer' should not be able to create projects if it does not have permission to then populate that project without asking an admin to intervene.

I don't understand, why I have enough permissions to create a project, but not to make it ready enough so I can push into it, and need to use another persons time in my organization to get ready to work.

IMHO it would be logical to either allow users with status developer to create a project in a way that it's ready to push code to - or just don't let developers create a project and tell them they have to ask a maintainer or owner.

Issue 51688 mentions:

Then I have to login with gitlab admin admin...Aggregate access to user test to test6.git as a dev or maintainer... and finally I can make push... But if user test creates another repo, I have to repeat all these steps again....

Maintainer can create new branch. Please use maintainer account to push the new project.

But it doesn't make sense that a user has permissions to create empty repositories but not initialize a default branch or push to their newly created repository.

Related