1
0
mirror of synced 2026-01-06 15:01:04 -05:00

Merge pull request #28280 from github/create-branch-6670

add instructions for creating a branch
This commit is contained in:
Sarita Iyer
2022-06-14 12:07:21 -04:00
committed by GitHub
5 changed files with 25 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@@ -15,17 +15,37 @@ topics:
- Pull requests
shortTitle: Create & delete branches
---
## Creating a branch
You can create a branch in different ways on {% data variables.product.product_name %}.
{% note %}
**Note:** You can only create a branch in a repository to which you have push access.
{% endnote %}
### Creating a branch via the branches overview
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.navigate-to-branches %}
1. Click **New branch**.
![Screenshot of branches overview page with new branch button emphasized](/assets/images/help/branches/new-branch-button.png)
2. In the dialog box, enter the branch name and optionally change the branch source.
3. Click **Create branch**.
![Screenshot of branch creation modal with create branch button emphasized](/assets/images/help/branches/branch-creation-popup.png)
1. Optionally, if you want to create your new branch from a branch other than the default branch for the repository, click {% octicon "git-branch" aria-label="The branch icon" %} **<em>NUMBER</em> branches** then choose another branch:
![Branches link on overview page](/assets/images/help/branches/branches-link.png)
### Creating a branch using the branch dropdown
{% data reusables.repositories.navigate-to-repo %}
1. Optionally, if you want to create the new branch from a branch other than the default branch of the repository, click {% octicon "git-branch" aria-label="The branch icon" %} **Branches** then choose another branch.
![Branches link on overview page](/assets/images/help/branches/branches-overview-link.png)
1. Click the branch selector menu.
![branch selector menu](/assets/images/help/branch/branch-selection-dropdown.png)
1. Type a unique name for your new branch, then select **Create branch**.
![branch creation text box](/assets/images/help/branch/branch-creation-text-box.png)
{% ifversion fpt or ghec or ghes > 3.4 %}
### Creating a branch for an issue
You can create a branch to work on an issue directly from the issue page and get started right away. For more information, see "[Creating a branch to work on an issue](/issues/tracking-your-work-with-issues/creating-a-branch-for-an-issue)".
{% endif %}
## Deleting a branch
{% data reusables.pull_requests.automatically-delete-branches %}

View File

@@ -1,2 +1,2 @@
1. Above the list of files, click {% octicon "git-branch" aria-label="The branch icon" %} **<em>NUMBER</em> branches**.
![Branches link on overview page](/assets/images/help/branches/branches-link.png)
1. Above the list of files, click {% octicon "git-branch" aria-label="The branch icon" %} **Branches**.
![Branches link on overview page](/assets/images/help/branches/branches-overview-link.png)