Hi @ClaytonAndTheClayton I’d expect there are a few ways to automate what you’re trying to do. Personally I use a merge bot to pull feature branches up to date. Answer from snim2 on forum.gitlab.com
🌐
GitLab
forum.gitlab.com › general
Is there a way to force Gitlab to merge "main" to your branch when you try to merge TO "main"? - General - GitLab Forum
February 2, 2022 - Here’s my issue. We have a master branch “main” that all MRs have to be merged to to be deployed. Before any MR can be merged to “main”, they must be approved by multiple peers, which can take awhile. We then hit merge, which does a squash-and-merge.
Discussions

Can I merge merge requests myself?
You just need to fix the conflict locally and push the fix to the source branch for your MR. You can use the GitLab UI to merge the MR afterwards. More on reddit.com
🌐 r/gitlab
11
1
July 4, 2023
git - Avoid push --force when updating a gitlab merge request - Stack Overflow
tl;dr How can I update a gitlab merge request the same way as a gerrit changeset? In a rather standard gitlab setting, I own a project and want it to keep a linear history. I set the merge settings More on stackoverflow.com
🌐 stackoverflow.com
Force Launch pipeline from Merge button on MR page
I have a .yml file that suppresses pipeline lauches for ^Draft MRs, and pushes where $CI_PIPELINE_SOURCE is not equal to “merge_request_event” or “web”. Still, we need to force the pipeline to start when the Merge button is pressed. I’ve tried all likely values of $CI_PIPELINE_SOURCE ... More on forum.gitlab.com
🌐 forum.gitlab.com
2
0
August 18, 2022
Merge request fast-forward if possible
Hello, if I understand the settings correctly I can force fast forward merges for my project but there is not an option to do fast-forward when it is possible. For me it would be eg. single commit merge request which can be fast forwarded. Am I right? What I want is to create a merge commit ... More on forum.gitlab.com
🌐 forum.gitlab.com
6
0
December 8, 2021
🌐
GitLab
docs.gitlab.com › user › project › merge_requests › methods
Merge methods | GitLab Docs
These diagrams show how the feature branch merges into main if you use the Merge commit strategy. They are equivalent to the command git merge --no-ff <feature>, and selecting Merge commit as the Merge method in the GitLab UI:
🌐
GitLab
docs.gitlab.com › topics › git › git_rebase
Rebase and resolve merge conflicts | GitLab Docs
Introduction to Git rebase and force push, methods to resolve merge conflicts through the command line.
🌐
Reddit
reddit.com › r/gitlab › can i merge merge requests myself?
r/gitlab on Reddit: Can I merge merge requests myself?
July 4, 2023 -

I don't know why I can't find anything on this topic, perhaps the question is just plain stupid.

I have to follow a certain workflow which in this case does not allow me to rebase nor merge one feature branch into another.

If I wasn't using GitLab I would simply create the necessary changes to resolve the conflict myself, merge, then solve the conflict using whatever was necessary to do so, thus creating a merge commit which explains the necessary changes to incorporate feature-a into branch-b.

How can I do this using GitLab though? All merge commits are created by GitLab, never myself. All branches except my own branches are protected. GitLab only tells me to "resolve locally" with a guide that simply seems to imply rebase is going to solve my problems (it won't), providing no further guidance.

Can I just merge locally, then push and GitLab will know my merge commit is in reference to the merge request? Will it allow my push because the merge request has been approved?

If so, do I have to add the references like "See merge request !123 for ..." to the merge commit description myself?

🌐
GitLab
gitlab.com › gitlab.org › #396344
Allow certain users/roles to merge an MR with a failed pipeline even if "Pipelines must succeed" is enabled (#396344) · Issues · GitLab.org / GitLab · GitLab
<!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.--> ### Proposal When ["Pipelines must succeed"](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html#require-a-successful-pipeline-for-merge) is enabled, certain users or roles should be able to "force merge" it regardless of pipeline status.
Top answer
1 of 2
2

Force push is a valid workflow in this case. It is not that dangerous, because the old version of the branch is still available locally via git reflog and on the server all the versions you pushed are also saved in gitlab (see https://docs.gitlab.com/ee/user/project/merge_requests/versions.html).

You can push modifications happening during the review in new commits and once the branch is ready to be merged use gitlab's squash commits functionality if you really want to avoid force pushing, but this offers less flexibility than using interactive rebase with force push, because it means that the whole branch will be turned into a single commit before being merged.

2 of 2
1

You do not need to force push to update a merge request, unless the change rewrites history.

For example, if you have an existing merge request with changes to my_branch and you want to make another change, you can do the following after making the changes to one or more files:

# In case newer changes have been made on the remote/GitLab
git pull origin my_branch

git add .
git commit -m 'Additional changes'
git push origin my_branch

The above does not require a force push because it has not rewritten the history. However, if you rewrite history such as through a rebase, a force push is required:

git add .
git commit -m 'Additional changes'
git rebase -i master
git push origin my_branch --force

The other scenario that could require a force push that doesn't involve a rebase is if there have been more changes to the branch from another user or directly from GitLab that you don't have on your local branch. If you don't pull those newer changes before making other changes, a force push would be required. But a force push would also be destructive so you probably don't want to do that. Instead, you would want to first pull those changes, as I gave in the first example, and then do a regular push after making your changes.

Find elsewhere
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
Force Launch pipeline from Merge button on MR page - GitLab CI/CD - GitLab Forum
August 18, 2022 - I have a .yml file that suppresses pipeline lauches for ^Draft MRs, and pushes where $CI_PIPELINE_SOURCE is not equal to “merge_request_event” or “web”. Still, we need to force the pipeline to start when the Merge butto…
🌐
GitLab
docs.gitlab.com › user › project › merge_requests
Merge requests | GitLab Docs
Ona supports the GitLab Development Kit (GDK). To use Ona, you must turn on Ona in your user account. Push changes from the command line, if you are familiar with Git and the command line. To assign the merge request to a user, use the /assign @user quick action in a text area in a merge request, or:
🌐
GitLab
docs.gitlab.com › user › project › merge_requests › auto_merge
Auto-merge | GitLab Docs
When you review a merge request, if you approve of the merge request’s changes, set it to auto-merge. GitLab enforces your project settings, and until the merge request satisfies all merge checks (like required Code Owner and approval rules), it cannot merge.
🌐
GitLab
forum.gitlab.com › general
Merge request fast-forward if possible - General - GitLab Forum
December 8, 2021 - Hello, if I understand the settings correctly I can force fast forward merges for my project but there is not an option to do fast-forward when it is possible. For me it would be eg. single commit merge request which ca…
🌐
Stack Overflow
stackoverflow.com › questions › 57296752 › git-merge-a-branch-to-master-on-gitlab
Git Merge a branch to master on GitLab - Stack Overflow
git fetch upstream git checkout master git reset --hard upstream/master git checkout yourBranch git rebase master git push --force
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › How-to-merge-any-GitLab-branch-into-master
How GitLab developers can merge any branch into master
August 31, 2020 - Only users in the developer or maintainer role in GitLab can merge branch into master or push a GitLab branch into master. For users who haven’t been granted the appropriate rights, a merge request is required to merge a topic branch or feature branch into master on GitLab.
🌐
GitLab
forum.gitlab.com › how to use gitlab
Only allow merges to main via Merge Request - How to Use GitLab - GitLab Forum
February 27, 2025 - Problem to solve I’m trying to set my repo up so that it will only allow merges to the main branch via merge requests. Is that possible? I can only find settings for allowing merges and pulls altogether, no settings tha…
🌐
Medium
medium.com › @lada496 › force-merge-in-git-796a1cb997e8
Force merge in Git. This is the last way to deal with merge… | by Lada496 | Medium
October 26, 2022 - What I learned from this problem is that we always have to be aware of the latest commit of the root branch and what branch we need to merge.
🌐
GitLab
docs.gitlab.com › ci › pipelines › merge_request_pipelines
Merge request pipelines | GitLab Docs
To run a pipeline that tests the result of merging the source and target branches together, use merged results pipelines. ... Your project’s .gitlab-ci.yml file must include job rules or workflow rules that match CI_PIPELINE_SOURCE == "merge_request_event".
🌐
GitLab
docs.gitlab.com › user › project › merge_requests › authorization_for_merge_requests
Merge request workflows | GitLab Docs
With the protected branch flow, everybody works in the same GitLab project, instead of forks. The project maintainers get the Maintainer role and the regular developers get the Developer role. Maintainers mark the authoritative branches as ‘Protected’. Developers push feature branches to the project and create merge requests to have their feature branches reviewed and merged into one of the protected branches.
🌐
GitLab
forum.gitlab.com › gitlab ci/cd
Notifcation on Force Merge of a MR even when the pipeline failed - GitLab CI/CD - GitLab Forum
April 29, 2022 - Do we have any option in gitlab to notify the admin or group when somebody force merge a merge request even when the pipeline is failed. I know we have the option to stop merging a MR in case of failure. But I don’t wan…