MmynameStackflow
MmynameStackflow

Reputation: 1251

Git Alias - Create multiple merge request from one source branch to multiple target branches

I'm trying to create a git alias to create three merge request (master, release, develop) from the current working branch. Somehow it doesn't recognize the -o merge_request.target=* on the seconde and third git push.

Currently I've got the following Git alias

[alias]
    mr-master = "!git push -o merge_request.create -o merge_request.target=master origin HEAD"
    mr-release = "!git push -o merge_request.create -o merge_request.target=release origin HEAD"
    mr-develop = "!git push -o merge_request.create -o merge_request.target=develop -o merge_request.remove_source_branch origin HEAD"

    hotfix = !git mr-master && git mr-release && git mr-develop

Running it by git hotfix will only create the first merge request but not the second or third, those return Everything up-to-date

Am I overlooking something or isn't this possible at all?

I'm running Git 2.44.0 locally on windows and using Gitlab 16.6.7-ee.

Upvotes: 0

Views: 64

Answers (0)

Related Questions