summaryrefslogtreecommitdiff
path: root/doc/user/workflow/protected_branches.md
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2016-06-21 13:28:50 +0200
committerAchilleas Pipinellis <axilleas@axilleas.me>2016-06-21 13:28:50 +0200
commit24ad2f4f0d9e8ebfd8133a572f29e52b74cd7dd5 (patch)
tree056c6dc55069e322db64875a1d16a65293a10ed8 /doc/user/workflow/protected_branches.md
parent0d287b06a6fa7a373df03378f9f1a048e5890a4f (diff)
downloadgitlab-ce-documentation_restructure.tar.gz
Restructure documentationdocumentation_restructure
The big plan in motion, see https://gitlab.com/gitlab-org/gitlab-ce/issues/3349
Diffstat (limited to 'doc/user/workflow/protected_branches.md')
-rw-r--r--doc/user/workflow/protected_branches.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/user/workflow/protected_branches.md b/doc/user/workflow/protected_branches.md
new file mode 100644
index 00000000000..d854ec1e025
--- /dev/null
+++ b/doc/user/workflow/protected_branches.md
@@ -0,0 +1,31 @@
+# Protected branches
+
+Permissions in GitLab are fundamentally defined around the idea of having read or write permission to the repository and branches.
+
+To prevent people from messing with history or pushing code without review, we've created protected branches.
+
+A protected branch does three simple things:
+
+* it prevents pushes from everybody except users with Master permission
+* it prevents anyone from force pushing to the branch
+* it prevents anyone from deleting the branch
+
+You can make any branch a protected branch. GitLab makes the master branch a protected branch by default.
+
+To protect a branch, user needs to have at least a Master permission level, see [permissions document](../permissions/permissions.md).
+
+![protected branches page](protected_branches/protected_branches1.png)
+
+Navigate to project settings page and select `protected branches`. From the `Branch` dropdown menu select the branch you want to protect.
+
+Some workflows, like [GitLab workflow](gitlab_flow.md), require all users with write access to submit a Merge request in order to get the code into a protected branch.
+
+Since Masters and Owners can already push to protected branches, that means Developers cannot push to protected branch and need to submit a Merge request.
+
+However, there are workflows where that is not needed and only protecting from force pushes and branch removal is useful.
+
+For those workflows, you can allow everyone with write access to push to a protected branch by selecting `Developers can push` check box.
+
+On already protected branches you can also allow developers to push to the repository by selecting the `Developers can push` check box.
+
+![Developers can push](protected_branches/protected_branches2.png) \ No newline at end of file