Manage a Branch
After you create a branch, you can rename it, compare it with another branch of the Git repository, or delete it.
You must be a project owner or member to edit and update a branch. You can perform the branch management actions from the Refs view of the Git page.
Action | How To |
---|---|
Rename a branch |
You can’t rename a restricted branch or the After renaming a branch, update all related merge requests, build jobs, and deployment configurations to use the new branch name. When you rename a branch, Git creates a branch with the new name and transfers all content from the old branch to the new branch. After the transfer is complete, the old branch is removed.
|
Compare branches |
In the branch list, to the right of branch name, click Actions
|
Protect a branch or set branch restrictions | In the branch list, to the right of branch name, click
Actions
![]() |
Delete a branch |
You can’t delete a restricted branch or the
After you delete a branch, update, close, or remove all related merge requests and build jobs. |