Skip to content

Commit f020661

Browse files
authored
Document renaming the default branch (#17204)
* Revert revert commit and address merge conflicts * Update Liquid syntax and versioning * Mention the good stuff * Revert findandreplaceghetti * Adjust versioning * Adjust versioning * Remove period * Revise permissions statement * Revise description of redirection behavior * Update screenshots * Update permissions tables * Document permissions for organizations * Tighten up permissions statement
1 parent 35c6d47 commit f020661

7 files changed

Lines changed: 39 additions & 4 deletions

File tree

383 KB
Loading
118 KB
Loading

content/github/administering-a-repository/changing-the-default-branch.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ You can choose the default branch for a repository. The default branch is the ba
2323
{% endnote %}
2424
{% endif %}
2525

26-
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" or currentVersion == "github-ae@latest" %}
26+
{% if currentVersion == "free-pro-team@latest" %}
27+
28+
You can also rename the default branch. For more information, see "[Renaming a branch](/github/administering-a-repository/renaming-a-branch)."
29+
30+
{% endif %}
31+
32+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
2733

2834
{% data reusables.branches.set-default-branch %}
2935

content/github/administering-a-repository/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ versions:
3333
{% link_in_list /restoring-a-deleted-repository %}
3434
{% topic_link_in_list /managing-branches-in-your-repository %}
3535
{% link_in_list /viewing-branches-in-your-repository %}
36+
{% link_in_list /renaming-a-branch %}
3637
{% link_in_list /changing-the-default-branch %}
3738
{% link_in_list /deleting-and-restoring-branches-in-a-pull-request %}
3839
{% topic_link_in_list /configuring-pull-request-merges %}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Renaming a branch
3+
intro: You can change the name of a branch in a repository.
4+
permissions: People with write permissions to a repository can rename a branch in the repository. People with admin permissions can rename the default branch.
5+
versions:
6+
free-pro-team: '*'
7+
---
8+
9+
### About renaming branches
10+
11+
You can rename a branch in a repository on {% data variables.product.product_location %}. For more information about branches, see "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches)."
12+
13+
If you rename a branch, {% data variables.product.prodname_dotcom %} will automatically redirect links on {% if currentVersion == "free-pro-team@latest" %}{% data variables.product.prodname_dotcom_the_website %}{% else %}{% data variables.product.product_location_enterprise %}{% endif %} that contain the old branch name to the equivalent link on the renamed branch. {% data variables.product.prodname_dotcom %} will also update branch protection policies, as well as the base branch for open pull requests and draft releases.
14+
15+
### Renaming a branch
16+
17+
{% data reusables.repositories.navigate-to-repo %}
18+
{% data reusables.repositories.navigate-to-branches %}
19+
1. In the list of branches, to the right of the branch you want to rename, click {% octicon "pencil" aria-label="The edit icon" %}.
20+
![Pencil icon to the right of branch you want to rename](/assets/images/help/branch/branch-rename-edit.png)
21+
1. Type a new name for the branch.
22+
![Text field for typing new branch name](/assets/images/help/branch/branch-rename-type.png)
23+
1. Review the information about local environments, then click **Rename branch**.
24+
![Local environment information and "Rename branch" button](/assets/images/help/branch/branch-rename-rename.png)

content/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ In addition to managing organization-level settings, organization owners have ad
100100
| Make a repository a template (see "[Creating a template repository](/articles/creating-a-template-repository)") | | | | | **X** |
101101
| Change a repository's settings | | | | | **X** |
102102
| Manage team and collaborator access to the repository | | | | | **X** |
103-
| Edit the repository's default branch | | | | | **X** |
103+
| Edit the repository's default branch | | | | | **X** |{% if currentVersion == "free-pro-team@latest" %}
104+
| Rename the repository's default branch (see "[Renaming a branch](/github/administering-a-repository/renaming-a-branch)") | | | | | **X** |
105+
| Rename a branch other than the repository's default branch (see "[Renaming a branch](/github/administering-a-repository/renaming-a-branch)") | | | **X** | **X** | **X** |{% endif %}
104106
| Manage webhooks and deploy keys | | | | | **X** |{% if currentVersion == "free-pro-team@latest" %}
105107
| [Enable the dependency graph](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-and-dependents-of-a-repository) for a private repository | | | | | **X** |
106108
| Receive [{% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies) in a repository | | | | | **X** |

content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ The repository owner has full control of the repository. In addition to the acti
2929
| :- | :- |
3030
| {% if currentVersion == "free-pro-team@latest" %}Invite collaborators{% else %}Add collaborators{% endif %} | "[Inviting collaborators to a personal repository](/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository)" |
3131
| Change the visibility of the repository | "[Setting repository visibility](/github/administering-a-repository/setting-repository-visibility)" |{% if currentVersion == "free-pro-team@latest" %}
32-
| Limit interactions with the repository | "[Limiting interactions in your repository](/github/building-a-strong-community/limiting-interactions-in-your-repository)" |{% endif %}
32+
| Limit interactions with the repository | "[Limiting interactions in your repository](/github/building-a-strong-community/limiting-interactions-in-your-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %}
33+
| Rename a branch, including the default branch | "[Renaming a branch](/github/administering-a-repository/renaming-a-branch)" |{% endif %}
3334
| Merge a pull request on a protected branch, even if there are no approving reviews | "[About protected branches](/github/administering-a-repository/about-protected-branches)" |
3435
| Delete the repository | "[Deleting a repository](/github/administering-a-repository/deleting-a-repository)" |
3536
| Manage the repository's topics | "[Classifying your repository with topics](/github/administering-a-repository/classifying-your-repository-with-topics)" |{% if currentVersion == "free-pro-team@latest" %}
@@ -61,7 +62,8 @@ Collaborators can also perform the following actions.
6162

6263
| Action | More information |
6364
| :- | :- |
64-
| Fork the repository | "[About forks](/github/collaborating-with-issues-and-pull-requests/about-forks)" |
65+
| Fork the repository | "[About forks](/github/collaborating-with-issues-and-pull-requests/about-forks)" |{% if currentVersion == "free-pro-team@latest" %}
66+
| Rename a branch other than the default branch | "[Renaming a branch](/github/administering-a-repository/renaming-a-branch)" |{% endif %}
6567
| Create, edit, and delete comments on commits, pull requests, and issues in the repository | <ul><li>"[About issues](/github/managing-your-work-on-github/about-issues)"</li><li>"[Commenting on a pull request](/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request)"</li><li>"[Managing disruptive comments](/github/building-a-strong-community/managing-disruptive-comments)"</li></ul> |
6668
| Create, assign, close, and re-open issues in the repository | "[Managing your work with issues](/github/managing-your-work-on-github/managing-your-work-with-issues)" |
6769
| Manage labels for issues and pull requests in the repository | "[Labeling issues and pull requests](/github/managing-your-work-on-github/labeling-issues-and-pull-requests)" |

0 commit comments

Comments
 (0)