GitLab: the changes of a merge request are cut short, or answer 404
GitLab's REST API gives the files a merge request changes in pages from List merge request diffs (GET /projects/:id/merge_requests/:merge_request_iid/diffs, GitLab 15.7 and later), and in one answer from the older GET /projects/:id/merge_requests/:merge_request_iid/changes, which GitLab deprecated in 15.7 and plans to remove in API v5. Both give what GitLab stored for the merge request, and the diff limits decide how much that is. The answers below are what gitlab.com said on October 25, 2026, with the rules from GitLab's documentation behind them.
HTTP/1.1 404 Not Found
{"message":"404 Not found"}
The diff limits
- Three limits: the number of files changed, the number of lines changed, and the size of the whole diff. They apply to the API as well as the UI. On GitLab Self-Managed the defaults are 1,000 files, 50,000 lines and 200 KB, and an administrator can raise them to 3,000 files, 100,000 lines and 500 KB. On GitLab.com they are 3,000 files, 100,000 lines and 200 KB, and cannot be changed.
- Collapsed and too large: when a diff reaches 10% of a limit, GitLab shows files collapsed; diffs over a limit are "Too large" and cannot be expanded in the UI.
200, but files or diffs are missing
changes_countends in "+": it is a string, not a number. When a merge request has too many changes to display and store, GitLab caps it and the documentation gives"1000+". The list of diffs has no flag of its own for this: compare how many files you received withchanges_countin the merge request (GET /projects/:id/merge_requests/:merge_request_iid)."overflow": truefrom/changes: the limits cut the results. Withaccess_raw_diffs=true, GitLab reads the diffs from Gitaly instead of its database: slower, and without the database's limits, though Gitaly's own limits still apply."collapsed": trueor"too_large": trueon a file: its diff is left out. A collapsed diff can be fetched on request; a too large one cannot be retrieved. GitLab added the two attributes to the list of diffs in 18.4.- A merge request just created:
changes_countanddiff_refsare empty at first and fill in shortly after, once GitLab has worked out the diff. - Pages: 20 files a page by default, up to 100 with
per_page(gitlab.com answered 100 a page when asked for 500).x-totalandx-next-pagesay how many files there are and which page is next.
404 from /diffs or /changes
404 Not found: the project has no merge request with that number (theiidshown in the merge request's address, not its globalid), or your token cannot see the project (see address or access).- A GitLab older than 15.7 has no list of diffs, so
/diffsanswers 404 there; use/changes.
What to do
- Over the limits: compare the branches yourself. GitLab keeps each merge request's head under
refs/merge-requests/IID/head:git fetch origin refs/merge-requests/IID/head, thengit diff origin/TARGET...FETCH_HEADshows every file. - On GitLab Self-Managed, an administrator can raise the limits in Admin > Settings > General > Diff limits (up to 3,000 files). Higher limits cost the instance more.
- A diff left out of the database: ask
/changeswithaccess_raw_diffs=true, or read the file at the two commits.
GitLab merge requests in IntelliJ IDEA
Merge Request Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, reads a merge request's changed files from the list of diffs, 100 a page, up to 3,000 files, and from /changes on a GitLab that answers 404 for the list. Each file opens in the IDE's diff with the whole file read at the merge base and at the head commit, so a file whose diff GitLab left out still shows its changes. From version 1.0.17, when GitLab kept only the first files (changes_count ending in "+", or "overflow": true) or there are more than 3,000, the count of viewed files says that only the first files are listed and that git diff shows the rest; before, the list ended without saying so. Right after a merge request is created, it asks again for a few seconds until GitLab has worked out the diff. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
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 404 "Project Not Found" · GitLab merge request list refused (400, 404) · GitLab 429 "Retry later" (rate limits) · GitLab 401 "invalid_token" · GitLab "insufficient_scope" · GitLab merge refused (405, 409, 422) · GitLab approval refused (401, 409) · GitLab comment or thread refused (400, 403) · GitLab merge request not created (409, 422, 400) · GitLab rebase refused or failed (403, 409) · GitLab auto-merge refused (405) or canceled · GitLab "compare_timeout": true (diff limits) · GitLab merge request plugins for IntelliJ IDEA, compared · 日本語