作者:Eliza | 来源:互联网 | 2022-12-06 16:38
我有一个目录,我想变成一个git项目.
我在gitlab中创建了一个新项目,然后我执行了以下操作:
git init
git remote add origin git@gitlab.com:a/b/c.git
git add .
git commit -m "Initial commit"
git push -u origin master
另外,我创建了以下.gitignore
文件:
*
!*/scripts
!*/jobs
运行后git push -u origin master
我得到以下错误:
Counting objects: 33165, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (32577/32577), done.
Writing objects: 100% (33165/33165), 359.84 MiB | 1.70 MiB/s, done.
Total 33165 (delta 21011), reused 0 (delta 0)
remote: Resolving deltas: 100% (21011/21011), done.
remote: GitLab:
remote: A default branch (e.g. master) does not yet exist for a/b/c
remote: Ask a project Owner or Maintainer to create a default branch:
remote:
remote: https://gitlab.com/a/b/c/project_members
remote:
To gitlab.com:a/b/c.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.com:a/b/c.git'
可能是什么问题?请指教
1> VonC..:
这链接到问题27456和合并请求6608:
记录是否需要拥有者或具有初始推送的主权限级别
因此,这可能是权限级别,而不是分支问题。
参见commit 81ee443:
由于master分支会自动受到保护,因此您必须是所有者或拥有初始推送的master权限级别。