万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・寄付お願いします
    YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
    BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
    c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1

GitLabでなぜかforce pushできない

こうなった

git push origin master --force
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (15/15), 2.18 KiB | 1.09 MiB/s, done.
Total 15 (delta 8), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To gitlab.com:shinriyo/monkey.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.com:shinriyo/monkey.git'

なぜ? 設定上自分はメンテナっぽいのに。

公式ドキュメント https://docs.gitlab.com/ee/user/project/protected_branches.html

設定の歯車 => 「リポジトリ」を選択する f:id:shinriyo:20180714131112p:plain

ここで選んで「Unprotect」

f:id:shinriyo:20180714131024p:plain

git push origin master --force
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (15/15), 2.18 KiB | 1.09 MiB/s, done.
Total 15 (delta 8), reused 0 (delta 0)
To gitlab.com:shinriyo/monkey.git
 + 249c755...c0f2766 master -> master (forced update)

yay!