From 825e76228794dbb044cd75d48241d8d14914f721 Mon Sep 17 00:00:00 2001 From: Jonathan Celestin <25135255+optimisticjc@users.noreply.github.com> Date: Wed, 14 Oct 2026 11:50:43 +0000 Subject: [PATCH] Clarify automatic branch deletion behavior for fork pull requests (#63763) Co-authored-by: Copilot Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../managing-the-automatic-deletion-of-branches.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md index 36711dfb1473..6174b6f6fb6b 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md @@ -15,6 +15,13 @@ category: --- Anyone with admin permissions to a repository can enable or disable the automatic deletion of branches. Branch protection rules and repository rules can also prevent branches being automatically deleted. For more information, see{% ifversion fpt or ghec %} [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets) and{% endif %} [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches). +For a pull request opened from a fork, {% data variables.product.prodname_dotcom %} uses the **Automatically delete head branches** setting on the head repository (the fork), not the base repository where the pull request is merged. Automatic deletion requires both of the following: + +* The setting is enabled on the fork. +* The user merging the pull request has write access to the fork. + +If either requirement isn't met, the head branch isn't deleted automatically. A user with write access to the fork can manually delete the branch from the merged pull request. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/deleting-and-restoring-branches-in-a-pull-request). + {% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} 1. On the "General" settings page, you can find a section called "Pull Requests". Under "Pull Requests", select or deselect **Automatically delete head branches**. @@ -23,3 +30,4 @@ Anyone with admin permissions to a repository can enable or disable the automati * [AUTOTITLE](/pull-requests/how-tos/merge-and-close-pull-requests/merging-a-pull-request) * [AUTOTITLE](/pull-requests/how-tos/commit-changes/managing-branches-within-your-repository) +* [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/deleting-and-restoring-branches-in-a-pull-request)