You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
GitHub should provide a per-repository branch-protection option for rejecting deletion of a branch if there’s a pull request still open which is based on that branch.
Rationale: With git, it’s unfortunately quite easy/common in practice to make the mistake of running a command such as git push --prune --all while having unintentionally omitted the name of a particular remote — in which case the branches will be pruned for the origin remote (or whatever the default remote is for the repo) rather than whatever other remote the person running that command actually intended but inadvertently forgot to include in the command.
For a repo with a lot of open branches and open pull requests, the consequences of having run an inadvertent git push --prune --all command like that can be a lot of work to deal with — since it’ll have the effect of both deleting all the branches while also closing all their associated pull requests. It can a lot of time/effort to recover all the branches and reopen all the PRs.
So it’d be great to have some way to protect a repo against this particular git footgun.
GitHub should provide a per-repository branch-protection option for rejecting deletion of a branch if there’s a pull request still open which is based on that branch.
Rationale: With git, it’s unfortunately quite easy/common in practice to make the mistake of running a command such as
git push --prune --allwhile having unintentionally omitted the name of a particular remote — in which case the branches will be pruned for theoriginremote (or whatever the default remote is for the repo) rather than whatever other remote the person running that command actually intended but inadvertently forgot to include in the command.For a repo with a lot of open branches and open pull requests, the consequences of having run an inadvertent
git push --prune --allcommand like that can be a lot of work to deal with — since it’ll have the effect of both deleting all the branches while also closing all their associated pull requests. It can a lot of time/effort to recover all the branches and reopen all the PRs.So it’d be great to have some way to protect a repo against this particular git footgun.