Can I enable the "automatically delete head branch" feature on GitHub

Quite recently GitHub added a new feature where head branches can automatically be deleted after the PR has been merged.

Can I enable this in CPython repo? It will save several API calls for miss-islington.
I don’t see why not, but wanted to check first.

I usually do it manually, so I wouldn’t mind. I wonder whether it might take other users by surprise, though.

1 Like

Does this apply only to the python/cpython repo, or to any fork? Does miss-islington create her branches in her own fork, and would setting this there achieve the goal?

Either way, I’m in favor :slight_smile:

Good questions.

I assumed it works on forks too. But I will make investigate further. Their changelog doesn’t say anything about forked repo or not.

miss-islington creates branches in her own fork.

In that case, I’d start with enabling it on her fork and see if that does what you want.

For that matter, you could save the API calls anyway, since nobody really looks at what branches are on her fork, as long as she doesn’t run into a limit on the number of allowed forks :slight_smile:

I’ve just tested in my personal repo, and sadly it won’t delete head branch in forked repo :pensive:
. Only if the head branch is created in the same repo`.

Since this won’t help miss-islington’s case, do we still want to enable it in python/cpython?

I’d say yes; anyone making a change via a branch on the main repo doesn’t have to remember to delete it when they’re done.


Done! :white_check_mark:


@Mariatta Does it delete the branch, if it’s checked on both the fork and the python/cpython?

I tried that, and no it doesn;t delete the branch that way :pensive:

1 Like