본문 바로가기

Dev/Git

[GitLab] You are not allowed to push code to protected branches on this project

 

 

 

git push -f 명령어를 사용하는데,

해당 오류가 발생되었다.

 

해당 에러는 push 하려는 branch 가 Protected로 설정 되어있기 때문에 발생하는 경우가 많다.
대부분의 경우는 Master Branch 가 이런 경우가 많고,

아니면 다른 브랜치에 대한 Permission 을 주는 경우가 이에 해당되는데

해결 방법은 사용중인 Project 에 들어가서 해당 Protected를 해제 하거나 권한을 설정하면 된다.

 

- GitLab Project -> Settings -> Repository -> Protected Branches -> [Expand] 버튼 클릭

 

 


하단에 Protected Branches  리스트에 우측 UnProtected를 클릭 혹은
Allowed to merge   Allowed to push 에서 권한을 설정 한다.

 

출처: https://ipex.tistory.com/entry/GitLab-You-are-not-allowed-to-push-code-to-protected-branches-on-this-project [깍돌이]

'Dev > Git' 카테고리의 다른 글

Git  (0) 2022.02.15
[GitLab] Project visibility 설정 (Private, Public, Internal)  (0) 2022.02.15