2015-09-11 14:41:01 +05:30
|
|
|
- page_title "Protected branches"
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
.row.prepend-top-default.append-bottom-default
|
|
|
|
.col-lg-3
|
|
|
|
%h4.prepend-top-0
|
|
|
|
= page_title
|
2016-08-24 12:49:21 +05:30
|
|
|
%p Keep stable branches secure and force developers to use merge requests.
|
|
|
|
%p.prepend-top-20
|
|
|
|
By default, protected branches are designed to:
|
|
|
|
%ul
|
|
|
|
%li prevent their creation, if not already created, from everybody except Masters
|
|
|
|
%li prevent pushes from everybody except Masters
|
|
|
|
%li prevent <strong>anyone</strong> from force pushing to the branch
|
|
|
|
%li prevent <strong>anyone</strong> from deleting the branch
|
|
|
|
%p.append-bottom-0 Read more about #{link_to "protected branches", help_page_path("user/project/protected_branches"), class: "underlined-link"} and #{link_to "project permissions", help_page_path("user/permissions"), class: "underlined-link"}.
|
2016-06-02 11:05:42 +05:30
|
|
|
.col-lg-9
|
|
|
|
%h5.prepend-top-0
|
|
|
|
Protect a branch
|
|
|
|
- if can? current_user, :admin_project, @project
|
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @protected_branch] do |f|
|
|
|
|
= form_errors(@protected_branch)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
.form-group
|
|
|
|
= f.label :name, "Branch", class: "label-light"
|
2016-08-24 12:49:21 +05:30
|
|
|
= render partial: "dropdown", locals: { f: f }
|
|
|
|
%p.help-block
|
|
|
|
= link_to "Wildcards", help_page_path('user/project/protected_branches', anchor: "wildcard-protected-branches")
|
|
|
|
such as
|
|
|
|
%code *-stable
|
|
|
|
or
|
|
|
|
%code production/*
|
|
|
|
are supported.
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
.form-group
|
|
|
|
= f.check_box :developers_can_push, class: "pull-left"
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :developers_can_push, "Developers can push", class: "label-light append-bottom-0"
|
|
|
|
%p.light.append-bottom-0
|
|
|
|
Allow developers to push to this branch
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.check_box :developers_can_merge, class: "pull-left"
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :developers_can_merge, "Developers can merge", class: "label-light append-bottom-0"
|
|
|
|
%p.light.append-bottom-0
|
|
|
|
Allow developers to accept merge requests to this branch
|
|
|
|
= f.submit "Protect", class: "btn-create btn protect-branch-btn", disabled: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
%hr
|
|
|
|
= render "branches_list"
|