Pull Requests as Branches

~169 words. ~0 minutes.

tags: git tutorial

Consider these questions:

I used to do these things too.

Then I discovered that, at least on Forgejo, you can just have the PRs show up as branches, just add the following configuration to your .git/config file.

[remote "origin-pr"]
        url = <your git repository’s url>
        fetch = +refs/pull/*/head:refs/remotes/pr-*

Then run,

git fetch origin-pr

Now you can check out any PR with

git checkout pr-<number>

Author: tusharhero

emailreplace [at] with @, and put the domain for username, and vice versa: sdf.org [at] tusharhero

© tusharhero 2024-2025, check licenses page for details.

Date: 2026-01-16 Fri 12:09

Emacs 31.0.50 (Org mode 9.7.11)