Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a GitLab merge request via command line

We are working on integrating GitLab (enterprise edition) in our tooling, but one thing that is still on our wishlist is to create a merge request in GitLab via a command line (or batchfile or similar, for that matter). We would like to integrate this in our tooling. Searching here and on the web lead me to believe that this is not possible with native GitLab, but that we need additional tooling for that.

Am I correct? And what kind of tooling would I want to use for this?

like image 570
patrick Avatar asked May 24 '16 09:05

patrick


People also ask

How do I merge codes in terminal?

To do a merge (locally), git checkout the branch you want to merge INTO. Then type git merge <branch> where <branch> is the branch you want to merge FROM. Because the history of master and the history of make_function share common ancestors and don't have any divergence descendents, we get a "fast-forward" merge.

How do you create merge request for specific commit in GitLab?

You can, however, create a new branch from your master branch, cherry-pick the single commit, and create a merge request for that branch, containing only the one commit. If you do not need the other commits any more, you can also consider an interactive rebase, to remove the unwanted commits from the branch.

How do I create a draft merge in GitLab?

Go to your project and select Merge requests. In the navigation bar, select Open, Merged, Closed, or All to filter by merge request status. Select the search box to display a list of filters and select Draft, or enter the word draft .


1 Answers

As of GitLab 11.10, if you're using git 2.10 or newer, you can automatically create a merge request from the command line like this:

git push -o merge_request.create 

More information can be found in the docs.

like image 64
Ahmad Sherif Avatar answered Sep 30 '22 04:09

Ahmad Sherif