summaryrefslogtreecommitdiff
path: root/doc/user
diff options
context:
space:
mode:
authorLuke Duncalfe <lduncalfe@gitlab.com>2019-04-05 13:22:58 +0000
committerLuke Duncalfe <lduncalfe@eml.cc>2019-04-09 10:03:26 +1200
commit68f189ad23d7a384f40caa152d263fdf1465b30a (patch)
tree36f9b0f177b6238c0a730f23134d80c02e79f982 /doc/user
parent1883e320eafa02b332a16eec658f65c4a28def83 (diff)
downloadgitlab-ce-68f189ad23d7a384f40caa152d263fdf1465b30a.tar.gz
Support merge on pipeline success w/ push options
MergeRequests::PushOptionsHandlerService has been updated to allow creating and updating merge requests with the `merge_when_pipeline_succeeds` set using git push options. To create a new merge request and set it to merge when the pipeline succeeds: git push -u origin -o merge_request.create \ -o merge_request.merge_when_pipeline_succeeds To update an existing merge request and set it to merge when the pipeline succeeds: git push -u origin -o merge_request.merge_when_pipeline_succeeds Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/53198
Diffstat (limited to 'doc/user')
-rw-r--r--doc/user/project/merge_requests/index.md31
1 files changed, 28 insertions, 3 deletions
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index 678fc3dd196..ba7d05a7ad7 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -223,9 +223,17 @@ branch already exists, the patches will be applied on top of it.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26752) in GitLab 11.10.
-GitLab supports using [Git push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt) to create merge requests and set the target
-branch during a push. Note that git push options are only available with
-Git 2.10 or newer.
+NOTE: **Note:**
+Git push options are only available with Git 2.10 or newer.
+
+GitLab supports using
+[Git push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
+to perform the following actions against merge requests at the same time
+as pushing changes:
+
+- Create a new merge request for the pushed branch.
+- Set the target of the merge request to a particular branch.
+- Set the merge request to merge when its pipeline succeeds.
### Create a new merge request using git push options
@@ -252,6 +260,23 @@ same time using a `-o` flag per push option:
git push -o merge_request.create -o merge_request.target=branch_name
```
+### Set merge when pipeline succeeds using git push options
+
+To set an existing merge request to
+[merge when its pipeline succeeds](merge_when_pipeline_succeeds.md), use
+the `merge_request.merge_when_pipeline_succeeds` push option:
+
+```sh
+git push -o merge_request.merge_when_pipeline_succeeds
+```
+
+You can also create a merge request and set it to merge when its
+pipeline succeeds at the same time using a `-o` flag per push option:
+
+```sh
+git push -o merge_request.create -o merge_request.merge_when_pipeline_succeeds
+```
+
## Find the merge request that introduced a change
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/2383) in GitLab 10.5.