Skip to content

Configure branch name for creating MR from an issue

Igor Drozdov requested to merge id-customizable-branch-name into master

What does this MR do and why?

A user can create a branch from an issue: https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-new-branch-from-an-issue. The default suggestion for the branch name is %{id}-%{hyphenated-title}. For example, for an issue with iid 3 and title Fix this issue, the branch 3-fix-this-issue is suggested.

This MR allows configuring branch name suggestions for creating an MR from an issue. It's possible to specify a template, using the following variables:

  • %{id} - iid of the issue
  • %{title} - hyphenated title of the issue

As a result, if a user configures feature/%{id} template, the branch feature/3 will be suggested for the case above.

The video is almost correct except after UI changes, the setting is in Repository > Branch names section now:

Screenshot_2022-10-19_at_10.58.41

configure_branch_for_issues

Related issue: #21243 (closed)

Edited by Igor Drozdov

Merge request reports