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.
Repository navigation
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
It would be nice if we could have a checkbox / button or something for pull requests to make it so, when the pull request is merged, rather than having to revisit the PR and manually click the "Delete branch" button, the branch for the pull request would be deleted automatically. This is one of the features @jessfraz was just tweeting about running out of GitHub API calls to implement for herself: https://twitter.com/jessfraz/status/930154061869002752
Just sent this suggestion to GitHub Support.
Reacted by Martin Bonnin, Rob van der Leek, William Boman, bhack, Francesco Puglisi, Changping Chen, Ed Morley, Alexander Kochetov, kenjiru, James Baldassari and 198 more
Reacted by Maor Rozenfeld, Martin, Alex Kladov, Seunggabi Kim, HanTrinh, Ankur Narkhede and Dmitri
Wow, that was fast, looks like they've got a template response email for feature requests:
Hi there,
Thanks for reaching out! I'd be happy to pass this along to the team to consider as a feature request. I can't promise if or when it will be implemented, but your suggestion is definitely in the right hands!
Reacted by Nikolay Derkach, Denis Tuzhik, Greg Kilian, Jacky Efendi, Bruno, Jumpei Sakatsu, Raj Nigam, Andreas Mueller, David Chin, Michal Augustýn and 8 more
Reacted by Jakub Kukul, ysgk, Denis Tuzhik, Greg Kilian, Andres Forero, Terry Chen, Jacky Efendi, Bruno, Raj Nigam, David Chin and 3 more
@mgoddard27 Assuming you mean GitHub Enterprise Server; yes. Normally GitHub ships features to Enterprise Server after they are battle-tested on GitHub.com. This could take a couple of months because of the quarterly release cadence for GitHub Enterprise Server.
On another note - a repository maintainer has access to enable / disable the merge button to allow merge commits / squash merging / rebase merging in the GitHub UI, but does not have the ability to see the new Automatically delete head branches setting. Was this intentional?
I don't have a timeline for the API yet, looking into it.
On another note - a repository maintainer has access to enable / disable the merge button to allow merge commits / squash merging / rebase merging in the GitHub UI, but does not have the ability to see the new Automatically delete head branches setting. Was this intentional?
re: the Maintainer role? I'll look into it.
Reacted by Glenn McDonald, tooomm and Dave Hirschfeld
After calling the API, the Automatically delete head branches setting turns off.
I have exactly the same issue, @clarkbw there is no option to toggle this through the API as well.
It would be great if this could be addressed :)
Reacted by Parker Finch, AraHaan, Alexandre Chouinard, Sander van Thillo, ymatrix1, gustavo panizzo, Dave Hirschfeld, Joe Lodato, osakiy, Patrick Marabeas and 1 more
As a bonus for those using PyGitHub, I've also raised a PR to enable this parameter to be configured, which has been merged and is available in PyGitHub 1.46
Activity
stuartpb commentedon Nov 13, 2017
Wow, that was fast, looks like they've got a template response email for feature requests:
pedro93 commentedon Nov 13, 2017
Amazing!
davyengone commentedon Feb 20, 2018
Is this feature request still pending? That would be great to have it
martinbonnin commentedon Feb 20, 2018
For what it's worth, I worked around this issue by writing a small script that auto-deletes merged branches every night. Not ideal but works.
jimbol commentedon Feb 27, 2018
Would you be willing to share that with us @martinbonnin? I'd
starthat repoericanderson commentedon Mar 22, 2018
This just annoyed me recently enough that I wrote a script. I intend to produce other useful things for working against git/gh inside it and PRs are welcome. Just ran it on internal instance to success: https://github.com/ericanderson/ghouls
treps commentedon May 9, 2018
Have there been any updates on whether this is going to be a thing anytime soon?
tonypiazza commentedon May 9, 2018
@lecoursen This would be very helpful. Can you give us an update on this?
monperrus commentedon May 11, 2018
I guess that this can be implemented as a webhook. Has anybody ever done so?
sparky005 commentedon Jun 6, 2018
+1 for this feature.
tansaku commentedon Jun 8, 2018
we'd love it too!
renoirtech commentedon Jun 14, 2018
Hey guys, what about the following announcements and help articles? It seems that this feature already existed and someday and simply being vanished?
Confused.
15 remaining items
teeberg commentedon Dec 11, 2018
You can automate this through GitHub actions now, e.g. using https://github.com/jessfraz/branch-cleanup-action
sindresorhus commentedon Dec 12, 2018
PR welcome for this on Refined GitHub: refined-github/refined-github#1024
amueller commentedon Jul 16, 2019
there is a button right after the merge button. That seems like enough, right?
clarkbw commentedon Jul 31, 2019
Auto-delete branches 🎉
Check it out! https://github.blog/changelog/2019-07-31-automatically-delete-head-branches-of-pull-requests/
mgoddard27 commentedon Aug 2, 2019
Will the 'auto-delete branches' feature be available on GitHub Enterprise as well, anytime soon?
SvanBoxel commentedon Aug 5, 2019
@mgoddard27 Assuming you mean GitHub Enterprise Server; yes. Normally GitHub ships features to Enterprise Server after they are battle-tested on GitHub.com. This could take a couple of months because of the quarterly release cadence for GitHub Enterprise Server.
testworksau commentedon Sep 3, 2019
@clarkbw any idea when an API to turn this setting on / off might arrive? It's not listed here:
https://developer.github.com/v3/repos/#edit
On another note - a repository maintainer has access to enable / disable the merge button to allow merge commits / squash merging / rebase merging in the GitHub UI, but does not have the ability to see the new
Automatically delete head branchessetting. Was this intentional?clarkbw commentedon Sep 3, 2019
I don't have a timeline for the API yet, looking into it.
re: the Maintainer role? I'll look into it.
testworksau commentedon Nov 6, 2019
@clarkbw I've found that this setting is unexpectedly being turned off on us when using the Edit repos endpoint.
We use the https://developer.github.com/v3/repos/#edit API to configure merge strategies on our repositories. We typically send the following information (and only the following information) in the patch request:
After calling the API, the
Automatically delete head branchessetting turns off.clarkbw commentedon Nov 6, 2019
That’s not good... can you send this through support so it gets to the right people? Thx!
meabed commentedon Nov 10, 2019
I have exactly the same issue, @clarkbw there is no option to toggle this through the API as well.

It would be great if this could be addressed :)
terowz commentedon Dec 16, 2019
do you have any idea when this will be available in the API as well?
or am I just missing the docs on it?
testworksau commentedon Feb 13, 2020
The bug has finally been fixed, and this parameter is now available through the API, as
delete_branch_on_merge.https://developer.github.com/v3/repos/#edit
As a bonus for those using PyGitHub, I've also raised a PR to enable this parameter to be configured, which has been merged and is available in PyGitHub 1.46
https://github.com/PyGithub/PyGithub/releases/tag/v1.46