proomt

Search

Search posts, papers, and topics

All posts

Mozilla Automation TeamJonathan Almeida2 min readtutorialintermediate

Checkout a Github pull request from one-off contributions

Summary

Adds a git alias that fetches and checks out a branch from a contributor’s fork in one command, avoiding dependence on the GitHub `gh` CLI.

  • Define a git alias `co` that parses `<owner>:<branch>` arguments, fetches the branch via `git@github.com:<owner>/<repo>.git`, and checks out `FETCH_HEAD`.
  • Works with any Git host by adjusting the remote URL; not tied to the `gh` CLI.
  • Useful for one‑off PR reviews where you don’t want to add a permanent remote.

Provides a host‑agnostic, scriptable way to test external contributions without cluttering your repo with extra remotes, useful in automation or quick debugging scenarios.

5/10

Related reading

  1. Reinventing issue tracking: Local-first and Git-native

    A devlog describing how Manganin’s issue tracker stores issues in a dedicated Git repo as plain files, after rejecting earlier approaches that tried to embed issue data in the code tree or Git refs. The author explains the pitfalls of using refs for issue storage, shows the low‑level Git commands needed for that approach, and then outlines the final design: a hidden sister repository where each i…

    Lobstersmanganin.dev6 minHN1lobste.rs27