Make images accessible in images/help/branch and images/help/branches (#34686)
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 259 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 67 KiB |
BIN
assets/images/help/branches/branch-rename-edit.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
assets/images/help/branches/branch-selection-dropdown.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 90 KiB |
BIN
assets/images/help/branches/create-branch-text.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
@@ -70,7 +70,7 @@ $ svn commit -m 'Added more_awesome topic branch'
|
||||
|
||||
You can confirm that the new branch exists in the repository's branch dropdown:
|
||||
|
||||

|
||||

|
||||
|
||||
You can also confirm the new branch via the command line:
|
||||
|
||||
|
||||
@@ -72,10 +72,11 @@ Here at {% data variables.product.product_name %}, our developers, writers, and
|
||||
### Create a branch
|
||||
|
||||
1. Click the **Code** tab of your `hello-world` repository.
|
||||
2. Click the drop down at the top of the file list that says **main**.
|
||||

|
||||
4. Type a branch name, `readme-edits`, into the text box.
|
||||
5. Click **Create branch: readme-edits from main**.
|
||||
1. Above the file list, click the dropdown menu that says **main**.
|
||||
|
||||

|
||||
1. Type a branch name, `readme-edits`, into the text box.
|
||||
1. Click **Create branch: readme-edits from main**.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ After a pull request has been merged, or closed, you can delete the head branch
|
||||
{% data reusables.pull_requests.retargeted-on-branch-deletion %}
|
||||
The following diagrams illustrate this.
|
||||
|
||||
Here someone has created a branch called `feature1` from the `main` branch, and you've then created a branch called `feature2` from `feature1`. There are open pull requests for both branches. The arrows indicate the current base branch for each pull request. At this point, `feature1` is the base branch for `feature2`. If the pull request for `feature2` is merged now, the `feature2` branch will be merged into `feature1`.
|
||||
Here someone has created a branch called `feature1` from the `main` branch, and you've then created a branch called `feature2` from `feature1`. There are open pull requests for both branches. The arrows indicate the current base branch for each pull request. At this point, `feature1` is the base branch for `feature2`. If the pull request for `feature2` is merged now, the `feature2` branch will be merged into `feature1`.
|
||||
|
||||

|
||||

|
||||
|
||||
In the next diagram, someone has merged the pull request for `feature1` into the `main` branch, and they have deleted the `feature1` branch. As a result, {% data variables.product.prodname_dotcom %} has automatically retargeted the pull request for `feature2` so that its base branch is now `main`.
|
||||
|
||||

|
||||

|
||||
|
||||
Now when you merge the `feature2` pull request, it'll be merged into the `main` branch.
|
||||
|
||||
|
||||
@@ -30,23 +30,25 @@ You can create a branch in different ways on {% data variables.product.product_n
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.navigate-to-branches %}
|
||||
1. Click **New branch**.
|
||||

|
||||
2. In the dialog box, enter the branch name and optionally change the branch source.
|
||||
If the repository is a fork, you also have the option to select the upstream repository as the branch source.
|
||||

|
||||
3. Click **Create branch**.
|
||||

|
||||
|
||||

|
||||
1. Under "Branch name", type a name for the branch.
|
||||
1. Under "Branch source", choose a source for your branch.
|
||||
- If your repository is a fork, select the repository dropdown menu and click your fork or the upstream repository.
|
||||
- Select the branch dropdown menu and click a branch.
|
||||
1. Click **Create branch**.
|
||||
{% endif %}
|
||||
|
||||
### 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.
|
||||

|
||||
1. Click the branch selector menu.
|
||||

|
||||
1. Type a unique name for your new branch, then select **Create branch**.
|
||||

|
||||
|
||||
1. Select the branch selector dropdown menu.
|
||||
|
||||

|
||||
1. Optionally, if you want to create the new branch from a branch other than the default branch of the repository, click another branch, then select the branch selector dropdown menu again.
|
||||
1. In the "Find or create a branch..." text field, type a unique name for your new branch, then click **Create branch**.
|
||||
|
||||

|
||||
|
||||
{% 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)".
|
||||
@@ -66,11 +68,12 @@ If the branch you want to delete is associated with an open pull request, you mu
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.navigate-to-branches %}
|
||||
1. Scroll to the branch that you want to delete, then click {% octicon "trash" aria-label="The trash icon to delete the branch" %}.
|
||||
 {% ifversion fpt or ghes > 3.5 or ghae > 3.5 or ghec %}
|
||||
1. If you try to delete a branch that is associated with at least one open pull request, you must confirm that you intend to close the pull request(s).
|
||||
|
||||
{% endif %}
|
||||
1. Next branch that you want to delete, click {% octicon "trash" aria-label="Delete BRANCH" %}.
|
||||
|
||||

|
||||
{%- ifversion fpt or ghes > 3.5 or ghae > 3.5 or ghec %}
|
||||
1. If the branch is associated with at least one open pull request, deleting the branch will close the pull requests. Read the warning, then click **Delete**.
|
||||
{%- endif %}
|
||||
|
||||
{% data reusables.pull_requests.retargeted-on-branch-deletion %}
|
||||
For more information, see "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches#working-with-branches)."
|
||||
|
||||
@@ -39,7 +39,6 @@ You can restore the head branch of a closed pull request.
|
||||
{% data reusables.repositories.list-closed-pull-requests %}
|
||||
4. In the list of pull requests, click the pull request that's associated with the branch that you want to restore.
|
||||
5. Near the bottom of the pull request, click **Restore branch**.
|
||||

|
||||
|
||||
## Further reading
|
||||
|
||||
|
||||
@@ -27,12 +27,11 @@ Although file URLs are automatically redirected, raw file URLs are not redirecte
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.navigate-to-branches %}
|
||||
1. In the list of branches, to the right of the branch you want to rename, click {% octicon "pencil" aria-label="The edit icon" %}.
|
||||

|
||||
1. Next to the branch you want to rename, click {% octicon "pencil" aria-label="Rename branch" %}.
|
||||
|
||||

|
||||
1. Type a new name for the branch.
|
||||

|
||||
1. Review the information about local environments, then click **Rename branch**.
|
||||

|
||||
|
||||
## Updating a local clone after a branch name changes
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ shortTitle: View branches
|
||||
|
||||
4. Optionally, use the search field on the top right. It provides a simple, case-insensitive, sub-string search on the branch name. It does not support any additional query syntax.
|
||||
|
||||

|
||||
|
||||
## Further reading
|
||||
|
||||
- "[Creating and deleting branches within your repository](/articles/creating-and-deleting-branches-within-your-repository)"
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
4. Next to "Branch protection rules", click **Add rule.**
|
||||

|
||||
5. Under "Branch name pattern", type the branch name or pattern you want to protect.
|
||||

|
||||
1. Next to "Branch protection rules", click **Add rule.**
|
||||
1. Under "Branch name pattern", type the branch name or pattern you want to protect.
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
1. Click **Closed** to see a list of closed pull requests.
|
||||

|
||||
1. To see a list of closed pull requests, click **Closed**.
|
||||
|
||||

|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
1. Above the list of files, click {% octicon "git-branch" aria-label="The branch icon" %} **Branches**.
|
||||

|
||||
1. Above the list of files, click {% octicon "git-branch" aria-label="" %} **Branches**.
|
||||
|
||||

|
||||
|
||||