What I try to accomplish to merge changes of forked repo into main repo. Both repo’s master branch are protected. I can accomplish it via Gitlab web pages. But unfortunately, Gitlab rest api for merge request does not have source_project_id attribute.
Is there any way to create merge request via command line for forked repo into main repo ?
When using the API, you would use the MR endpoint for the source project -- the fork that you created.
Suppose the "main" project is
owner/main-projectand your fork isuser/main-project-forkYou would use the MR API endpoint (
/projects/:id/merge_requests) using theid(or url-encoded path) ofuser/main-project-fork. Then you would provide thetarget_project_idparameter using the ID of theowner/main-projectproject.