Do not push your branch before the following commands. If you push your branch before it will not work. Git response is going to be
Everything up-to-date and the merge request will not be created.- Push
my-branchto the remote repository and create a new merge request from our branch to themainbranch of the project.
git push -o merge_request.create origin my-branch
- Push
my-branchto the remote repository and the target branchworkwith the merge request title<title>and a merge request description<description>, setting the merge request to remove the source branch when itβs merged:
git push \
-o merge_request.create \
-o merge_request.target=work \
-o merge_request.title="<title>" \
-o merge_request.description="<description>" \
origin my-branch
References:
- 1 GitLab Documentation