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
