🚀Astro-notion-blog

Notion記事をAstroを利用してブログ化

Post title iconGitlabでPushエラー

最近、Githubばかり利用してて、久しぶりにGitlabのリポジトリを修正作業した。

リポジトリの修正で、少し前のコミットに戻そうとしたところ

$ git push origin master -f
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'gitlab.com:user/myrepo.git' 

あれ?、git clonegit pullも普通に出来るのにPush出来ない?

githubでは通常の操作なのに?

原因

Gitlabではプロジェクトのmasterブランチに保護がかかっているのが原因

解決

Gitlabへログインし、該当のリポジトリを開き、

左下の⚙設定からリポジトリを選択し、Protected branches項目を展開

master ブランチが保護されているので、Unprotectを押す

Image in a image block