0

My local branch already pushed to origin and set upstream (or not, tried both cases) Next i run the next command in my project connected to gitlab:

git push (also added here "origin $branch" sometimes) -o merge_request.create \
        -o merge_request.title=$title \
        -o merge_request.description=$description \
        -o merge_request.assign=$assignee \
        -o merge_request.target=master

After executing i get "Everything up to date" message, that's meaning by default it's ok.

But at gitlab merge requests page there's no new of them. Have read in gitlab official issues that upstreaming branch would not take any effect in this case, but the story works only if branch is pushed to origin.

So tried to push it without upstream and still no effect. How may i do the trick, anyone know ?


I tried different variants of pushing MR request. I expect the command above taken from doc to work properly, if needed - edit it in some way.

  • What version of Git are you running? Is this gitlab.com or a self-hosted instance? If it's a self-hosted instance, what version? – Jim Redmond Apr 03 '23 at 22:31
  • @JimRedmond git version is 2.30.1. Organizational gitlab.. Some time ago i was able to do so from git CLI, came back to my script and now cannot do it. – Gadzhiev Islam Apr 03 '23 at 22:55
  • Thanks - good to know that it had been working previously, that clears up a few versioning issues. Are you passing any unescaped spaces in the different MR field variables? – Jim Redmond Apr 03 '23 at 23:06
  • I could get some education on this _but_, to the best of my knowledge, that is not stuff that you can setup in a `git push` (merge requests or pull requests are not a git concept). – eftshift0 Apr 04 '23 at 02:07
  • 1
    @eftshift0 One can use Git push options to setup merge requests when pushing to Gitlab: https://docs.gitlab.com/ee/user/project/push_options.html#push-options-for-merge-requests – phd Apr 04 '23 at 04:59
  • 1
    @GadzhievIslam "Everything up to date" doesn't mean it's ok. It means nothing was pushed because there were no new commits. If nothing was pushed merge request options were ignored. No new merge request. – phd Apr 04 '23 at 05:03

0 Answers0