For deleting a branch, the "Delete Reference" permission is sufficient.

Bug: Issue 7490
Change-Id: Ic7f1bb9793ac42de6857da24149f2f3959259754
This commit is contained in:
Gert van Dijk
2017-10-19 22:38:06 +02:00
parent 6219e30fa2
commit 8c5e33ce11
3 changed files with 11 additions and 3 deletions

View File

@@ -602,7 +602,7 @@ safest mode as commits cannot be discarded.
* Force option
+
Allows an existing branch to be deleted. Since a force push is
Implies <<category_delete,Delete Reference>>. Since a force push is
effectively a delete immediately followed by a create, but performed
atomically on the server and logged, this option also permits forced
push updates to branches. Enabling this option allows existing commits

View File

@@ -272,13 +272,20 @@ There are several ways to delete a branch:
- in the Web UI under 'Projects' > 'List' > <project> > 'Branches'
- via the link:rest-api-projects.html#delete-branch[Delete Branch]
REST endpoint
- by using a git client to force push nothing to an existing branch
- by using a git client
+
----
$ git push origin --delete refs/heads/<branch-to-delete>
----
+
another method, by force pushing nothing to an existing branch:
+
----
$ git push --force origin :refs/heads/<branch-to-delete>
----
To be able to delete branches, the user must have the
link:access-control.html#category_delete[Delete Reference] or the
link:access-control.html#category_push[Push] access right with the
`force` option. In addition, project owners and Gerrit administrators
can delete branches from the Web UI or via REST even without having the