Lesstep
GitLab · merge requests · merge checks · file locking · Checked November 19, 2026

GitLab: a merge request blocked by a locked file

GitLab has two kinds of file lock, and each can stop a merge. A merge request that changes a file or directory locked in the GitLab page cannot merge into the default branch (locked_paths, "The files must not be locked by another user."); one that changes a file with a Git LFS exclusive lock held by someone else cannot merge either (locked_lfs_files, "The LFS files must not be locked by another user.") (GitLab docs: file locking, checked November 19, 2026).

The two kinds of lock

To see that a lock is what blocks a merge request: Merge Request (MR) Review Inbox for GitLab, a plugin for JetBrains IDEs, lists the merge checks from detailed_merge_status with the blocking ones first.

Whose lock counts

When a merge request that changes locked paths is set to merge, GitLab compares the merge request author with the lock's owner; it does not look at commit authors. The author who holds the lock can merge. A different author is blocked. Because only the author is compared, another user who pushes to the branch of a merge request can change locked files without blocking it. GitLab suggests approval rules that require review, and care over who may push to existing merge request branches.

What to do

Locks are also bypassed when a fork is updated from its upstream project, which can overwrite locked files in the fork.

GitLab merge requests in IntelliJ IDEA

Merge Request (MR) Review Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a merge request's merge checks before you merge: approvals, requested changes, unresolved threads, the pipeline, conflicts, and GitLab's other reasons from detailed_merge_status, with the ones that block the merge first, and the head pipeline with a link. The lock reasons are among GitLab's other reasons it lists, so a merge request held up by a lock shows it before you merge. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.

More: GitLab merge refused (405, 409, 422) · GitLab rebase refused or failed (403, 409) · GitLab "The merge conflicts for this merge request cannot be resolved through GitLab" · GitLab "Merge request dependencies must be merged"