summaryrefslogtreecommitdiff
path: root/doc/user/project/push_options.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 21:06:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 21:06:42 +0000
commitd5e0416021aa6de53b89f9d415f368226d9326e5 (patch)
tree9a3e3bd6d1aac10cfde7f0079f784a489491a48b /doc/user/project/push_options.md
parent24fe7aa2aa199b2aace0cfec26d744f51d7e2167 (diff)
downloadgitlab-ce-d5e0416021aa6de53b89f9d415f368226d9326e5.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/project/push_options.md')
-rw-r--r--doc/user/project/push_options.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/user/project/push_options.md b/doc/user/project/push_options.md
index 51c46dbd1d4..8952f845b96 100644
--- a/doc/user/project/push_options.md
+++ b/doc/user/project/push_options.md
@@ -75,3 +75,33 @@ merge request, and target a branch named `my-target-branch`:
```shell
git push -o merge_request.create -o merge_request.target=my-target-branch
```
+
+Additionally if you want the merge request to merge as soon as the pipeline succeeds you can do:
+
+```shell
+git push -o merge_request.create -o merge_request.target=my-target-branch -o merge_request.merge_when_pipeline_succeeds
+```
+
+## Useful Git aliases
+
+As shown above, Git push options can cause Git commands to grow very long. If
+you use the same push options frequently, it's useful to create [Git
+aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases). Git aliases
+are command line shortcuts for Git which can significantly simplify the use of
+long Git commands.
+
+### Merge when pipeline succeeds alias
+
+To set up a Git alias for the [merge when pipeline succeeds Git push
+option](#push-options-for-merge-requests):
+
+```shell
+git config --global alias.mwps "push -o merge_request.create -o merge_request.target=master -o merge_request.merge_when_pipeline_succeeds"
+```
+
+Then to quickly push a local branch that will target master and merge when the
+pipeline succeeds:
+
+```shell
+git mwps origin <local-branch-name>
+```