0
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?

【GitHub】プルリクマージ時に自動で作業ブランチを削除する設定(+削除しないブランチの設定)

Posted at

はじめに

リモートにブランチ残りまくってても嫌です。
プルリクをマージしたあとに作業ブランチを手動で削除するのすら面倒です。
なので設定。

ただし
release/*maindevelopなどのブランチは消えては困るので消えないようにしたい

プルリクマージ後にブランチを自動で削除する設定

※マージのみでありクローズされた場合は削除されません。

  1. 対象のリポジトリを開く
  2. 上部メニューのSettingsをクリック
  3. 左側メニューからGeneralを選択
  4. 下の方にスクロールしてPull Requestsセクションを見つける
  5. Automatically delete head branchesにチェックを入れる
    スクリーンショット 2025-06-29 145009.png

削除されたくないブランチを設定する

下記のの記事を参考に保護ブランチにする。
【GitHub】ブランチ削除防止の設定

※マージしてもプルリク画面にブランチ削除ボタンなどが表示されなくなる。

補足

個人的ブランチ管理

ブランチ 用途 保護推奨
main 本番環境
develop 開発用
release/* バージョン管理
feature/* 一時的な開発
fix/* 一時的なバグ修正

0
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
0
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?