A default branch cannot be chosen for an empty project.
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
A default branch cannot be chosen for an empty project.
But I can not commit and push to the project:
Steps to reproduce
- Create project repository
- Create user, upload SSH key and grant access to this project
- On local host: git init; git add remote origin path:to/this_project
- create some files and commit them
- git push origin
What is the current bug behavior?
$ git push office
Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Delta compression using up to 2 threads
Compressing objects: 100% (40/40), done.
Writing objects: 100% (46/46), 34.46 KiB | 2.46 MiB/s, done.
Total 46 (delta 1), reused 0 (delta 0), pack-reused 0
remote: GitLab:
remote: A default branch (e.g. main) does not yet exist for office/stack
remote: Ask a project Owner or Maintainer to create a default branch:
remote:
remote: https://local/gitlab/office/stack/-/project_members
remote:
To office:office/stack
! [remote rejected] dev -> dev (pre-receive hook declined)
error: failed to push some refs to 'office:office/stack'
What is the expected correct behavior?
Would be nice to have a button to create bare commit and allow to configure default branch.
Allow to push, when there is no default branch yet.
Results of GitLab environment info
Gitlab 15.5.1
**What is the command to get detailed info?
Edited by 🤖 GitLab Bot 🤖