Skip to content

Instantly share code, notes, and snippets.

@xfyuan
Last active February 16, 2022 07:59
Show Gist options
  • Save xfyuan/a290fbd885af75fba742b4267a1ea23d to your computer and use it in GitHub Desktop.
Save xfyuan/a290fbd885af75fba742b4267a1ea23d to your computer and use it in GitHub Desktop.
Create GitLab Merge Request from terminal
@xfyuan
Copy link
Author

xfyuan commented Feb 16, 2022

Create GitLab Merge Request from terminal

把如下 alias 添加到 ~/.gitconfig

[alias]
  mmr = "!git push origin HEAD -o merge_request.create -o merge_request.target=master -o merge_request.merge_when_pipeline_succeeds -o merge_request.label=\"canary\" -o merge_request.title=\"$(git branch --show-current)\""
  rmr = "!git push origin HEAD -o merge_request.create -o merge_request.target=release -o merge_request.merge_when_pipeline_succeeds -o merge_request.title=\"$(date \"+CI-%y%m%d\")\""

说明

  • 在feat/hotfix 分支上,执行git mmr,创建该分支到 master 的 MR
  • 在 master 分支上,执行git rmr,创建 master 到 release 的 MR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment