2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitHubでMainブランチを保護する方法

Posted at

mainブランチを保護する

mainブランチはpull requestを使って編集するものです。
直接編集することはしません。
なので、編集を拒否する設定をします。

リポジトリのsettingsにアクセス

github.comでリポジトリを開いて、画面上部の「Settings」をクリックしてください。
Image from Gyazo

Branches設定にアクセス

画面左側のメニューから「Branches」をクリックしてください。
Image from Gyazo

ルールの追加

「Add branch protection rule」をクリック
Image from Gyazo

情報の入力

Branch name patternに「main」と入力します。
「Require a pull request before merging」にチェックを入れてください。
デフォルトで「Require approvals」にチェックが入っています。
プルリク承認前にコードレビューを必須にしたい場合は残してください。
Image from Gyazo

一番下まで行き「Create」をクリックします。
Image from Gyazo

以上

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?