diff --git a/app/views/admin/application_settings/_initial_branch_name.html.haml b/app/views/admin/application_settings/_initial_branch_name.html.haml
new file mode 100644
index 0000000000000000000000000000000000000000..e76374e88a88c7099ae841d1bb16b1ada7de4ccc
--- /dev/null
+++ b/app/views/admin/application_settings/_initial_branch_name.html.haml
@@ -0,0 +1,12 @@
+= form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-default-branch-name'), html: { class: 'fieldset-form' } do |f|
+ = form_errors(@application_setting)
+
+ - fallback_branch_name = 'master'
+
+ %fieldset
+ .form-group
+ = f.label :default_branch_name, _('Default initial branch name'), class: 'label-light'
+ = f.text_field :default_branch_name, placeholder: 'master', class: 'form-control'
+ %span.form-text.text-muted
+ = (_("Changes affect new repositories only. If not specified, Git's default name %{branch_name_default} will be used.") % { branch_name_default: fallback_branch_name } ).html_safe
+ = f.submit _('Save changes'), class: 'gl-button btn-success'
diff --git a/app/views/admin/application_settings/repository.html.haml b/app/views/admin/application_settings/repository.html.haml
index b0934a9d9fb5cfb76181258a4ea2d02a36299fb1..11de79cf4a2eaf2fb2fc9075178e61f9278d259a 100644
--- a/app/views/admin/application_settings/repository.html.haml
+++ b/app/views/admin/application_settings/repository.html.haml
@@ -2,6 +2,18 @@
- page_title _("Repository")
- @content_class = "limit-container-width" unless fluid_layout
+- if Feature.enabled?(:global_default_branch_name)
+ %section.settings.as-default-branch-name.no-animate#js-default-branch-name{ class: ('expanded' if expanded_by_default?) }
+ .settings-header
+ %h4
+ = _('Default initial branch name')
+ %button.gl-button.js-settings-toggle{ type: 'button' }
+ = expanded_by_default? ? _('Collapse') : _('Expand')
+ %p
+ = _('Set the default name of the initial branch when creating new repositories through the user interface.')
+ .settings-content
+ = render 'initial_branch_name'
+
%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index ea171aa2e0d64cf4b92dba553f07979c5aaafd4e..489d39bc436738994c8ae7f344bbd16b50a2a8f8 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4260,6 +4260,9 @@ msgstr ""
msgid "Changes"
msgstr ""
+msgid "Changes affect new repositories only. If not specified, Git's default name %{branch_name_default} will be used."
+msgstr ""
+
msgid "Changes are shown as if the source revision was being merged into the target revision."
msgstr ""
@@ -7405,6 +7408,9 @@ msgstr ""
msgid "Default first day of the week in calendars and date pickers."
msgstr ""
+msgid "Default initial branch name"
+msgstr ""
+
msgid "Default issue template"
msgstr ""
@@ -21068,6 +21074,9 @@ msgstr ""
msgid "Set the default expiration time for each job's artifacts. 0 for unlimited. The default unit is in seconds, but you can define an alternative. For example: 4 mins 2 sec, 2h42min."
msgstr ""
+msgid "Set the default name of the initial branch when creating new repositories through the user interface."
+msgstr ""
+
msgid "Set the due date to %{due_date}."
msgstr ""
diff --git a/spec/views/admin/application_settings/repository.html.haml_spec.rb b/spec/views/admin/application_settings/repository.html.haml_spec.rb
new file mode 100644
index 0000000000000000000000000000000000000000..b110bc277acdbc9f457914f8e59fe1b8b2d0ed8f
--- /dev/null
+++ b/spec/views/admin/application_settings/repository.html.haml_spec.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'admin/application_settings/repository.html.haml' do
+ let(:app_settings) { build(:application_setting) }
+ let(:user) { create(:admin) }
+
+ before do
+ assign(:application_setting, app_settings)
+ allow(view).to receive(:current_user).and_return(user)
+ end
+
+ describe 'default initial branch name' do
+ context 'when the feature flag is disabled' do
+ before do
+ stub_feature_flags(global_default_branch_name: false)
+ end
+
+ it 'does not show the setting section' do
+ render
+
+ expect(rendered).not_to have_css("#js-default-branch-name")
+ end
+ end
+
+ context 'when the feature flag is enabled' do
+ before do
+ stub_feature_flags(global_default_branch_name: true)
+ end
+
+ it 'has the setting section' do
+ render
+
+ expect(rendered).to have_css("#js-default-branch-name")
+ end
+
+ it 'renders the correct setting section content' do
+ render
+
+ expect(rendered).to have_content("Default initial branch name")
+ expect(rendered).to have_content("Set the default name of the initial branch when creating new repositories through the user interface.")
+ end
+ end
+ end
+end