Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a branch undeletable in GitHub

Tags:

git

github

Is it possible to mark a branch as being not deletable after a pull request has been merged in GitHub?

The reason is that we wish to have a long-lived "vNext" branch which will, from time to time, be merged back to master but should not be deleted.

like image 762
Kram Avatar asked Aug 02 '26 00:08

Kram


1 Answers

In your project, select the "Settings" tab on the far right of the menu. In the menu on the left hand side of the "Settings" page, select "Branches". Under the "Protected Branches" section, select any branch you wish from force push and deletion.

like image 183
Code-Apprentice Avatar answered Aug 03 '26 12:08

Code-Apprentice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!