我有一个目录,我想将其转换为git项目。

我在gitlab中创建了一个新项目,然后执行以下操作:

git init
git remote add origin [email protected]: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 '[email protected]:a/b/c.git'

可能是什么问题?
请指教

最佳答案

这链接到issue 27456merge request 6608:



因此,这可能是权限级别,而不是分支问题。

参见commit 81ee443:

关于git - 由于以下原因而无法将文件推送到git:无法推送一些引用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52026119/

10-13 02:17