2020年7月15日水曜日

"git push -f" failed with "You are not allowed to force push code to a protected branch on this project" on GitLab

I would like to push my git branch by compulsion to my GitLab remote repository, but I couldn't do it with the following error.

$ git push -f
 : (snip)
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 3.22 KiB | 3.22 MiB/s, done.
Total 9 (delta 0), reused 8 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.

Resolution:
Do the following procedure on the web page of your GitLab repository .

1. [Settings] -> [Repository] -> [Protected Branches]
   Push "Expand " button

2. If  a branch is protected, you must see "Unprotect" button. Pushing the "Unprotect" button allows you to force commit.

0 件のコメント:

コメントを投稿