diff options
Diffstat (limited to 'doc/user/project/repository/branches/index.md')
-rw-r--r-- | doc/user/project/repository/branches/index.md | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/doc/user/project/repository/branches/index.md b/doc/user/project/repository/branches/index.md index 7c09ce5c580..e43efca600a 100644 --- a/doc/user/project/repository/branches/index.md +++ b/doc/user/project/repository/branches/index.md @@ -29,8 +29,8 @@ Branches are the foundation of development in a project: To create a new branch from the GitLab UI: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Repository > Branches**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Code > Branches**. 1. On the top right, select **New branch**. 1. Enter a **Branch name**. 1. In **Create from**, select the base of your branch: an existing branch, an existing @@ -52,7 +52,7 @@ Prerequisites: To add a [default branch](default.md) to an empty project: -1. On the top bar, select **Main menu > Projects** and find your project. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. 1. Scroll to **The repository for this project is empty** and select the type of file you want to add. 1. In the Web IDE, make any desired changes to this file, then select **Create commit**. @@ -62,7 +62,14 @@ GitLab creates a default branch and adds your file to it. ### From an issue +Prerequisites: + +- You must have at least the Developer role in the project. + When viewing an issue, you can create an associated branch directly from that page. +Branches created this way use the +[default pattern for branch names from issues](#configure-default-pattern-for-branch-names-from-issues), +including variables. Prerequisites: @@ -70,8 +77,8 @@ Prerequisites: To create a branch from an issue: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Issues** (**{issues}**) and find your issue. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Plan > Issues** and find your issue. 1. Below the issue description, find the **Create merge request** dropdown list, and select **{chevron-down}** to display the dropdown list. 1. Select **Create branch**. A default **Branch name** is provided, based on the @@ -104,8 +111,8 @@ You can manage your branches: To view and manage your branches in the GitLab user interface: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Repository > Branches**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Code > Branches**. On this page, you can: @@ -142,8 +149,8 @@ Prerequisites: To view the **Branch rules overview** list: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Settings > Repository**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Settings > Repository**. 1. Expand **Branch Rules** to view all branches with protections. - To add protections to a new branch: 1. Select **Add branch rule**. @@ -193,8 +200,9 @@ Prerequisites: To change the default pattern for branches created from issues: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Settings > Repository** and expand **Branch defaults**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Settings > Repository**. +1. Expand **Branch defaults**. 1. Scroll to **Branch name template** and enter a value. The field supports these variables: - `%{id}`: The numeric ID of the issue. - `%{title}`: The title of the issue, modified to use only characters acceptable in Git branch names. @@ -230,8 +238,8 @@ new changes. It uses the merge base, not the actual commit content, to compare b To compare branches in a repository: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Repository > Compare revisions**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Code > Compare revisions**. 1. Select the **Source** branch to search for your desired branch. Exact matches are shown first. You can refine your search with operators: - `^` matches the beginning of the branch name: `^feat` matches `feat/user-authentication`. @@ -244,15 +252,22 @@ To compare branches in a repository: ## Delete merged branches -![Delete merged branches](img/delete_merged_branches.png) +Merged branches can be deleted in bulk if they meet all of these criteria: + +- They are not [protected branches](../../protected_branches.md). +- They have been merged into the project's default branch. + +Prerequisites: + +- You must have at least the Developer role in the project. -This feature allows merged branches to be deleted in bulk. Only branches that -have been merged into the project's default branch and -[are not protected](../../protected_branches.md) are deleted as part of -this operation. +To do this: -It's particularly useful to clean up old branches that were not deleted -automatically when a merge request was merged. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Code > Branches**. +1. On the upper right corner of the page, select **More** **{ellipsis_v}**. +1. Select **Delete merged branches**. +1. In the modal window, enter the word `delete` to confirm, then select **Delete merged branches**. ## Related topics @@ -308,8 +323,8 @@ Error: Could not set the default branch. Do you have a branch named 'HEAD' in yo To fix this problem: -1. On the top bar, select **Main menu > Projects** and find your project. -1. On the left sidebar, select **Repository > Branches**. +1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project. +1. Select **Code > Branches**. 1. Search for a branch named `HEAD`. 1. Make sure the branch has no uncommitted changes. 1. Select **Delete branch**, then **Yes, delete branch**. |