GitHub: why the comparison was refused
Two commits are compared with GET /repos/OWNER/REPO/compare/BASE...HEAD. Like a pull request's Files changed, it is a three-dot comparison: the files from the merge base (the newest commit both share) to the head, and the commits of git log BASE..HEAD. Branches and commits of forks in the same repository network can be compared; a fork's branch is written USERNAME:BRANCH. GitHub's documentation lists 200, 404, 422, 500 and 503 for it (checked October 25, 2026).
{"message": "No common ancestor between 03f7ef390fef7f30111e6a5bafc345f4389cbea8 and 5b4d124ec29c81900f0c34a89c7de23405dbd791."}
Server Error: Sorry, this diff is taking too long to generate. (HTTP 422)
GitHub's words and the reasons
No common ancestor between … and ….(404 in a public report from 2022): the two commits share no history, so there is no merge base to compare from; for example, one branch was started without a parent commit.- 404 without that sentence: a branch or commit GitHub does not have in this repository or its network (deleted, never pushed, misspelled), or the repository is not there for this token, which is also how GitHub answers a private repository the token cannot see.
Sorry, this diff is taking too long to generate.: GitHub could not compute the comparison in time. Public reports met it as 422 on GitHub.com in 2026, including withper_page=1, and as 500 on a GitHub Enterprise Server in 2020. In one of them, CI tried three times, and the same comparison still gave the error when the report was written. For a request that GitHub ends after 10 seconds, see an API request timed out.- 500 and 503 are also in GitHub's list (internal error, service unavailable).
Limits that cut a comparison short, with no error
- 250 commits: without
per_pageorpage, the list stops at 250 commits, the last one being the newest of the whole comparison. - 300 files: with paging, the changed files come on the first page only, up to 300 for the whole comparison;
per_pagegoes up to 100 commits. - A pull request's own list (
GET /repos/OWNER/REPO/pulls/NUMBER/files) goes further, to 3,000 files (see GitHub diff 406 "too_large").
The base commit a pull request keeps
- GitHub's documentation says that when a pull request is opened, GitHub sets its base to the commit the base branch points to, and does not update that commit when the branch moves on.
- Comparing that commit with the head directly is a two-dot comparison. The documentation says a two-dot comparison changes when the base branch is updated, even if the topic branch did not; a branch that has merged newer base commits then shows their changes as its own.
- When a head branch is deleted after its pull request is merged, GitHub changes open pull requests that used it as their base to the merged pull request's base, the documentation says.
What to do
- No common ancestor: there is nothing to compare from; merge or rebase the branch onto the base branch so the two share history.
- Too long to generate: compare smaller steps, or read the changed files with git (
git diff --name-only BASE...HEAD); one public report explored getting the file list from git instead. - More than 250 commits or 300 files: page through the commits; for the files, use the pull request's file list or git.
- 404: check that both commits are pushed to the repository or a fork in its network, that the branch still exists, and that the token can see the repository (see which permission to add).
GitHub pull requests in IntelliJ IDEA
Pull Request Inbox for GitHub, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, compares the target branch with the pull request's head to find the merge base its diffs start from and whether the target has new commits (shown with an "Update the branch" link). When GitHub refuses that comparison, the diffs start from the base commit the pull request names instead, and the Files tab says so: changes merged in from the target since the pull request was opened may show as its own, and whether the target has moved on is not known. To mark the files that changed since you last looked at a pull request, it compares the head you saw with the new one; when GitHub refuses that, or lists 300 files or more, it cannot tell which files changed, so it clears your viewed marks for that pull request, says so on the Files tab, and marks none as "changed since you last looked". The review inbox, diffs and conversations are free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
GitHub is a trademark of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitHub, Inc. or JetBrains.
More: GitHub merge refused (405, 409) · GitHub review refused (422) · GitHub search 422 "Validation Failed" · "Resource not accessible by personal access token" · 401 "Bad credentials" · "Resource protected by organization SAML enforcement" · "API rate limit exceeded" · GitHub diff 406 "too_large", 3,000 files · GitHub line comment 422 "must be part of the diff" · GitHub branch update refused (422) · GitHub pull request not created (422, 403) · GitHub auto-merge refused · GitHub draft, ready for review or close refused · GitHub conversation not resolved · GitHub checks not shown (check runs 403) · GitHub file contents not read · GitHub comment or reply refused (403 locked, archived) · GitHub merge method not allowed (405) · GitHub branch not found (404, 301) · GitHub Enterprise Server not reached · GitHub review request not shown · GitHub pull request list incomplete · GitHub 404 Not Found, renamed repositories (301, 307) · GitHub line comment outdated or not on the diff · GitHub pull requests not updating, notifications late · GitHub suggested change cannot be applied · GitHub required check stuck at "Expected" · GitHub code owner review required · GitHub merge blocked by unresolved conversations · GitHub merge blocked by unsigned commits · GitHub branch that merges through a merge queue · GitHub merge waiting for an approval of the most recent push · GitHub merge waiting for code scanning results · GitHub merge waiting for code quality results · GitHub merge blocked by a code coverage threshold · GitHub merge blocked by license compliance results · GitHub branch locked or its updates restricted · GitHub branch not deleted after merging · GitHub merge waiting for a team's approval (Required reviewers) · GitHub merge blocked by secret scanning alerts · GitHub stacked pull request not merging · GitHub push blocked by push rules · GitHub merge blocked by commit metadata rules · GitHub force push blocked · GitHub issue not closed by a merged pull request · GitHub pull request not checked out locally · GitHub pull request has merge conflicts · GitHub changes requested and dismissing a review · GitHub co-author not credited for a commit · GitHub dependency review check failed · GitHub Dependabot not rebasing its pull request · GitHub fork not syncing with upstream · GitHub pull request base branch not changing · GitHub pull request not reverting · GitHub pull request template not showing · GitHub pull request labels or assignees not added · GitHub pull request not closing or reopening · GitHub push blocked by push protection · GitHub pull request comment hidden · GitHub pull request blocked until deployments succeed · GitHub team review request replaced by members · GitHub pull request file no longer marked Viewed · GitHub pull request marked merged without being merged · GitHub Copilot review does not count as an approval · GitHub checks not running on a pull request a workflow created · GitHub Update branch button not shown on a pull request · GitHub checks failing on a Dependabot pull request · GitHub checks failing on a pull request from a fork · GitHub checks skipped by [skip ci] in a commit message · GitHub checks gone after the retention period · GitHub code review limits in a public repository · GitHub pull requests turned off or limited in a repository · GitHub checks run on every pull request in a stack · GitHub pull request showing commits already squash merged · GitHub pull request not showing a file diff · GitHub push to a pull request branch from a fork refused · GitHub check cancelled on a pull request · GitHub Rebase and merge not available · GitHub merge commit message not what you expected · GitHub pull request shows every line changed · GitHub API request timed out · GitHub pull request image or document diff not shown · GitHub review request refused (422) · GitHub pull request from Copilot: checks not running, approval not counted · GitHub push refused: GH006 and GH013 on a protected branch · GitHub "At least 1 approving review is required", approvals that do not count · GitHub pull request plugins for IntelliJ IDEA, compared · 日本語