3
Where I work, we use a variation of Gitflow in which, when a hotfix
enters the product code, there is only the merge to the master
which, when approved, we propagate to the develop
through the branch master 2 develop
(or simply m2d
).
I’m making a requisition curl
to open the merge request. Currently I have the following (already with the creation of the branch m2d
as up to date as possible):
git fetch
git push origin +origin/master:refs/heads/m2d
curl --request POST https://gitlab.com/api/v4/projects/${project_id}/merge_requests --header "PRIVATE-TOKEN: ${mytoken}" --data "{
\"id\": \"${project_id}\",
\"title\": \"m2d\",
\"source_branch\": \"m2d\",
\"target_branch\": \"develop\"
}"
However, I get the following output from curl
:
{"error":"title is missing, source_branch is missing, target_branch is missing"}
I tried to follow the tips of that question no Stack Overflow international, putting the relevant information/JSON in the shipping body, but I couldn’t figure out what I’m doing wrong.
I can, using the same token, successfully make the following request:
curl https://gitlab.com/api/v4/projects/${project_id} --header "PRIVATE-TOKEN: ${mytoken}"
I don’t know if you’ve seen this their blog post, there’s an example there.
– NoobSaibot
It’s not five minutes since I saw it, and I got it working. But if you want to write down the answer and show me what I forgot to send in the requisition, I’ll be grateful
– Jefferson Quesado
Otherwise, tomorrow I answer
– Jefferson Quesado
Can answer hehe I do not understand much what it says there rsrs, also I have no time to translate.
– NoobSaibot
@Noobsaibot, I replied, I believe it was a little more than the publication of the site
– Jefferson Quesado
Tip: whenever you are going to execute something that fails, use the parameter
--verbose
(abbreviated I believe it to be-v
), being like thiscurl --verbose --request ...
– Guilherme Nascimento