Closed KyleKing closed 1 year ago
Thanks for the suggestion! If the branch you don't want to delete is always local, it seems easy to make a mistake typing a long command each time.
How about persisting the branch locally to protect once you run the command, like gh poi protect stage prod
, and not deleting the branch until you run gh poi unprotect stage prod
? (persist in .git/config like gh https://github.com/cli/cli/blob/ba27e5bfb88bab29021ae0eace03348e41f0b24f/git/client.go#L118)
That's a good idea and works for me!
Should there be a command to list all protected branches? Maybe "gh poi protect" with no arguments?
I am thinking of displaying the reasons for non-deletion in the gh poi
results (could be used to display reasons for non-deletion other than protect)
gh poi --dry-run
Deleted branches
issue2
└─ #2 https://github.com/owner/repo/pull/2 seachicken
Branches not deleted
prod [protected] <- here
└─ #1 https://github.com/owner/repo/pull/1 seachicken
I just released v0.9.0!
You can try gh ext upgrade poi
, then gh poi protect stage prod
.
I updated, and the feature works, thanks!
Description
We use a git branching strategy to have our branches mirror deployment environments (Stage and Prod). Because we merge code between the branches,
poi
deletes these protected branches locally and checks out main, but I don't want to switch to main if Prod is currently checked out.Could there be a command line option to ignore certain branches following a regex or string? Something like one of: