How to create a GitLab merge request via command line

patrick picture patrick · May 24, 2016 · Viewed 72.8k times · Source

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?

Answer

Ahmad Sherif picture Ahmad Sherif · May 1, 2019

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.