Since GitLab didn't have any CLI tool similar to GitHub (hub), I find it a very cumbersome task to raise a GitLab Merge Request to develop
branch. Though GitLab automatically returns a URL which can be used to create a Merge Request, by default it proceed with master
branch (or whatever is your default branch)
I created this small python script, which uses the GitLab APIs to generate a Merge Request, where the Target Branch for Merge Request can be passed as an argument.
Origin is extracted from the Git remote URL. This works fine if you're using SSH based URL, else modify the logic on Line #9.
Title is the last commit message
Target Branch defaults to master
, which can be passed as first parameter to override. (createMergeRequests.py develop
)
Source Branch is current branch, which can be passed as second parameter to override. (createMergeRequests.py develop master
)
For quick use, I've placed the script in home directory, so it's can be accessed with ~/createMergeRequest.py
. Make file executable, and replace the Line #1 with your python3 bin path.