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

标签 git gitlab

我第一次无法将代码推送到 GitLab。

我在 Web 界面上创建了一个 Gitlab 项目。
我创建了一个 ASP MVC 项目。
我在那个目录中做了“git init”。
我添加了远程 origin .
我添加并提交了更改,然后,当我想将更改推送到远程时,出现以下错误:

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

所以我想知道我是否可以创建一个角色为Developer的分支?
如果是,如何创建默认分支?
如果不是,我的下一步应该是什么?

最佳答案

接下来是 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提到:

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.

关于git - 如何在 GitLab 中创建默认分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60984084/

相关文章:

git - 连接到 Heroku node.js 应用程序中的数据库,而不在 git 上显示身份验证详细信息

java - Gradle中基于Git的自动版本控制

git fsck : duplicateEntries: contains duplicate file entries - cannot push to gitlab

亚搏体育appGitLab CI : How to fail on new compiler warnings

git - "Index-pack failed"

git - 如何在 git 中对 master 进行紧急修复?

git - 如何列出添加到 GIT 存储库第一次提交的所有文件?

authentication - 需要帮助修复此错误 "Connection reset by peer - SSL_connect"

Gitlab-ci 和 deploy.sh

docker - GitLab CI - 无法登录到 Docker Registry (x509)