Skip to content

Commit 8b39dc4

Browse files
authored
Merge pull request #46317 from github/repo-sync
Repo sync
2 parents e52ecac + 825e762 commit 8b39dc4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎content/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-the-automatic-deletion-of-branches.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ category:
1515
---
1616
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).
1717

18+
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:
19+
20+
* The setting is enabled on the fork.
21+
* The user merging the pull request has write access to the fork.
22+
23+
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).
24+
1825
{% data reusables.repositories.navigate-to-repo %}
1926
{% data reusables.repositories.sidebar-settings %}
2027
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
2330

2431
* [AUTOTITLE](/pull-requests/how-tos/merge-and-close-pull-requests/merging-a-pull-request)
2532
* [AUTOTITLE](/pull-requests/how-tos/commit-changes/managing-branches-within-your-repository)
33+
* [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/deleting-and-restoring-branches-in-a-pull-request)

0 commit comments

Comments
 (0)