-
Notifications
You must be signed in to change notification settings - Fork 129
Auto-delete branch on pull request merge #1121
Comments
Wow, that was fast, looks like they've got a template response email for feature requests:
|
Amazing! |
Is this feature request still pending? That would be great to have it |
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. |
Would you be willing to share that with us @martinbonnin? I'd |
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 |
Have there been any updates on whether this is going to be a thing anytime soon? |
@lecoursen This would be very helpful. Can you give us an update on this? |
I guess that this can be implemented as a webhook. Has anybody ever done so? |
+1 for this feature. |
we'd love it too! |
Hey guys, what about the following announcements and help articles? It seems that this feature already existed and someday and simply being vanished?
Confused. |
@renoirfaria read carefully ;) This issue is about automatically delete branch after merge. Not click on button action. |
Not to mention it would be nice to be able to physically delete issues and pull requests. I know it is a simple curl delete request away but I do not get the actual params I need to delete invalid issues/pull requests manually nor do I always have the ability as I have to use my iPhone most of the time on github unfortunately. Althought it would be nice if there was a button to export issues and pull requests to files though (with the file names being the name of the pull request/issue number). |
@wareczek right, but both alternatives (automatic and button deletion) seems to be are no longer available. |
No. Button is still there after merge. You can delete or restore branch. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
+1 |
I just got the idea. One could make a CI bot for their org that can detect pr merge and then check if the base branch is in the same repository, if so then delete it but then the CI would have to have means of editing the repository itself for that though. But at least it would be something. However like github pages it would be nice if only could setup a folder or whatever under branch master that then would run the ci itself automatically using Github as the host. For those who cannot run it on their devices and do not have money for a VPS or something to run it elsewhere. No programming language preference on this comment though so any language that can be used to make a Github CI is ok. on the Api though it has pr’s like this right?
|
Maybe this will do the job: https://developer.github.com/v3/git/refs/#delete-a-reference |
This comment has been minimized.
This comment has been minimized.
2 similar comments
+1 |
+1 |
@SvanBoxel it works, but sadly that seems more of a hack than anything. It would be nice if that bot was automatically installed on any newly made repository from now on and does not require a per-user installation unless it is for enabling it on a older or old repository. |
You could also leverage a Mergify rule, see: |
I've implemented this feature as a GitHub App. Looking for beta-testers. Check out https://github.com/apps/always-be-closing if you're interested. Any feedback would be appreciated at https://github.com/thoughtdealership/abc-users. |
You can automate this through GitHub actions now, e.g. using https://github.com/jessfraz/branch-cleanup-action |
PR welcome for this on Refined GitHub: refined-github/refined-github#1024 |
there is a button right after the merge button. That seems like enough, right? |
Auto-delete branches 🎉 Check it out! https://github.blog/changelog/2019-07-31-automatically-delete-head-branches-of-pull-requests/ |
Will the 'auto-delete branches' feature be available on GitHub Enterprise as well, anytime soon? |
@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. |
@clarkbw any idea when an API to turn this setting on / off might arrive? It's not listed here: 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 |
I don't have a timeline for the API yet, looking into it.
re: the Maintainer role? I'll look into it. |
@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 |
That’s not good... can you send this through support so it gets to the right people? Thx! |
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 :) |
do you have any idea when this will be available in the API as well? |
The bug has finally been fixed, and this parameter is now available through the API, as 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 |
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.
The text was updated successfully, but these errors were encountered: