로컬 PC에서 commit 을 한 후 GitLab에 push를 하려니 아래와 같이 정상적으로 되지 않았다.
error: src refspec origin does not match any.
error: failed to push some refs to 'git@gitlab.com:PROJECT/PROJECT_NAME.git'
C:\Users\1004lucifer\Downloads\PROJECT_NAME>git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 221 bytes | 221.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab:
remote: A default branch (e.g. master) does not yet exist for PROJECT/PROJECT_NAME
remote: Ask a project Owner or Maintainer to create a default branch:
remote:
remote: https://gitlab.com/PROJECT/PROJECT_NAME/project_members
remote:
To gitlab.com:PROJECT/PROJECT_NAME.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.com:PROJECT/PROJECT_NAME.git'
C:\Users\1004lucifer\Downloads\PROJECT_NAME>
원인
1004lucifer
Developer 권한은 master에 푸시할수 없으며, 브랜치를 만들어 푸시 후 Maintainer 에게 머지 요청을 해야 한다.
나의 경우에는 Maintainer 역할이 따로 없었기에 push 할 계정에 Maintainer 권한을 부여를 했다.
아래는 해당 권한을 부여 후 문제없이 push가 되는 모습.
C:\Users\1004lucifer\Downloads\PROJECT_NAME>
C:\Users\1004lucifer\Downloads\PROJECT_NAME>git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 221 bytes | 221.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gitlab.com:PROJECT/PROJECT_NAME.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
C:\Users\1004lucifer\Downloads\PROJECT_NAME>
댓글
댓글 쓰기