Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 15

Deleting protected branches is hard

Not long ago I requested Branch Protection on multiple branches, and that works great (thanks github!). However, there is one fatal flaw with it:

 

Removing stale protected branches is really hard.

 

For example, say my branch protection pattern is release-?.?, once I've released release-4.0 I want to delete release-3.0, but in order to do so, I have to remove my branch protection, delete it, then quickly add the branch protection back.

 

It would be great if I could delete a protected branch as an admin with some kind of confirmation.

14 Replies
Commander Lvl 3
Message 2 of 15

Re: Deleting protected branches is hard

Why not leave the protected branch up on GitHub? It's always nice to have some kind of back-up to see where things come from.


- Mark
Copilot Lvl 2
Message 3 of 15

Re: Deleting protected branches is hard

We have tags for backup. The branch is just added noise and can confuse engineers creating new PRs.

Pilot Lvl 1
Message 4 of 15

Re: Deleting protected branches is hard

This is interesting and you're being impacted as we are too (but for a different reason). Please see my recent post:

 

https://github.community/t5/How-to-use-Git-and-GitHub/Code-Review-Problems/td-p/14439

 

 

Ground Controller Lvl 1
Message 5 of 15

Re: Deleting protected branches is hard

I agree, this is a problem for us too. A lot of our protected branches only need to exist for a time, and then we remove them. It'd be nice to at least have admin delete rights on the branches list

Ground Controller Lvl 1
Message 6 of 15

Re: Deleting protected branches is hard

The issue affects us, as well.

Admins should have the right to delete protected branches, maybe with extra confirmation checkbox, like "I want to use my admin priviledges..."

Copilot Lvl 2
Message 7 of 15

Re: Deleting protected branches is hard

We have a similar problem, we were trying to follow a similar development pattern as described here on stackoverflow and introduced branch protection and hooks for the story branches however they can't be removed once the story is complete and merged in master.

Ground Controller Lvl 1
Message 8 of 15

Re: Deleting protected branches is hard

Agree.
I have protection on `feature/*` branches. Sometimes feature fail during development and I want to delete this branch. Can't do this. It there any solution for deleting them?

Ground Controller Lvl 1
Message 9 of 15

Re: Deleting protected branches is hard

I just temporarily amended the Branch protection rule so that it applies to 0 branches, removed the desired branches, then reverted the rule.

Ground Controller Lvl 1
Message 10 of 15

Re: Deleting protected branches is hard

I've done this too. It works but it's not ideal