2

I need to create a merge request from a forked GitLab repository into the original repository, while running a bash script.

0

1 Answer 1

4

Use the API

An example merge request would look like this:

curl --header "PRIVATE-TOKEN: " -X POST https://gitlab.example.com/api/v3/projects/project_id/merge_requests/?target_project_id=id_of_parent_project

Sign up to request clarification or add additional context in comments.

5 Comments

Thank you. The GitLab API documentation (docs.gitlab.com/ee/api/merge_requests.html) says: POST /projects/:id/merge_requests Could you please explain how I am supposed to come from this to what you wrote? I am asking since I need to understand the syntax for my particular URL.
What exactly is unclear
It said: "projects/:id", you said: "project_id". Also, where did you get this variable name: target_project_id?
The project id can be grabbed from the API too, using the projects endpoint. The variable target_project_name is an attribute in the API docs listed above.
Yes, thank you, I got it: it is something like: curl --header "PRIVATE-TOKEN: XXXXXX" -X POST "gitlab.example.com/api/v3/projects 12345merge_requests?source_branch=XXXXXX& target_branch=XXXXXX&title=Test&target_project_id=12356" Sorry about multiple attempts to format properly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.