简体   繁体   English

如何在 GitLab 中创建默认分支?

[英]How to create a default branch in GitLab?

I am not able to push code to GitLab for the first time.我第一次无法将代码推送到 GitLab。

I have created a Gitlab project on the web interface.我在 Web 界面上创建了一个 Gitlab 项目。
I have created an ASP MVC project.我创建了一个 ASP MVC 项目。
I did " git init " in that directory.我在那个目录中做了“ git init ”。
I added remote origin .我添加了远程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 ?所以我想知道我是否可以创建一个角色为Developer的分支?
If yes how to create a default branch?如果是,如何创建默认分支?
If no, what should my next steps be?如果不是,我的下一步应该是什么?

This is followed by issue 54155接下来是问题 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:问题 51688提到:

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....然后我必须使用 gitlab admin admin 登录...作为devmaintainer将用户 test 的访问权限聚合到 test6.git ......最后我可以进行推送......但是如果用户test创建另一个存储库,我必须重复所有这些步骤再次......

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.但是,用户有权创建空存储库但不能初始化默认分支或推送到他们新创建的存储库是没有意义的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM