Lesstep
Forgejo · Gitea · Pull requests · Checked November 27, 2026

Forgejo and Gitea: find the pull request that brought a commit in

You have a commit ID, or a line in blame that looks wrong, and you want the pull request it came through: the discussion, the review, who merged it. Forgejo and Gitea, including Codeberg and gitea.com, answer this with one API call. Below are the call, the case where it answers 404 although a pull request exists, a git command for that case, and the same thing in IntelliJ IDEA. From the API description that Codeberg and gitea.com publish (codeberg.org/api/swagger, gitea.com/api/swagger) and the Gitea source, models/issues/pull.go.

The API call

Which commits it finds

For a commit merged with a merge commit: git

Find the merge on the target branch that brought the commit in, then ask the call above with that merge's ID. In Bash (Git Bash on Windows), replace <commit>:

for m in $(git rev-list --first-parent --merges --reverse origin/main); do
  git merge-base --is-ancestor <commit> $m && { git log -1 --oneline $m; break; }
done

It walks the merges of origin/main from the oldest and prints the first one that contains the commit. The shorter git log --merges --ancestry-path <commit>..origin/main can stop at the wrong merge when main was merged into the branch after the commit. When the commit was pushed to main directly, or came in with a rebase merge, the merge this prints did not bring it in; check that the commit is not on git rev-list --first-parent origin/main first.

Find Pull Request on Forgejo / Gitea in IntelliJ IDEA

Pull Request Inbox for Forgejo and Gitea, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the Forgejo and Gitea pull requests waiting for your review in an IDE tool window. Find Pull Request on Forgejo / Gitea is on the annotate (blame) gutter and on a commit in the Git log. It asks the call above; from version 1.0.47, when the server answers 404, it finds the merge on the checked-out branch (HEAD) that brought the commit in, as above, and asks about that merge. The pull request it finds opens on the server; when there is none it says so, with the likely reasons. Finding the pull request is free; approving, commenting and merging are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Forgejo, Gitea and Codeberg are names of their respective owners; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by the Forgejo project, Codeberg e.V., the Gitea project or JetBrains.

More: the plugin · Forgejo and Gitea Actions runs in the IDE · 日本語