Skip to content

Add Git push option to merge when pipeline succeeds

If I am pushing to a branch with an open merge request, and I have write access to the target branch, it would be handy to be able to push and merge in a single action. This means that on my own projects where I want my change to go straight into master as long as the pipelines are green it is a single action once the merge request is created.

I would be able to:

  • create merge request from issue
  • checkout feature branch
  • push to feature branch with push option, and my change will automatically merge if it passes CI

Proposal

Working on a feature branch, I will be able to push and trigger a merge as soon as CI succeeds.

  • Push my change with git push -u origin -o merge.target=branch -o merge.on_success
  • GitLab will create a merge request and set the merge request to merge when pipelines succeed

Links / references

Edited by James Ramsay (ex-GitLab)