brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: gh pr checkout 123 fetches a pull request branch for you

CLI
~/tips/gh-pr-checkout

gh pr checkout 123

Switches to the branch of a GitHub pull request using only its number.

Reviewing a pull request locally used to mean adding a remote and finding the branch name. The GitHub CLI does it with the number.

gh pr checkout 123
gh pr checkout https://github.com/owner/repo/pull/123

It fetches the branch of that pull request and switches to it, also when it comes from a fork. You need the GitHub CLI and to be logged in once with gh auth login. Run it inside a clone of the repository.

Caveat: reading code is safe, running it is not. Do not start the tests or an install script of a pull request from someone you do not know on a machine that holds your keys.

Further reading: gh pr checkout

Going deeper: Moving on from hdtv: how to export your TV show list to Trakt.tv

More CLI tips printf 'GET /\r\n' | hexdump -C hexdump -C -s 512 -n 64 disk.img wget --limit-rate=2m https://example.com/big-file.iso wget --spider https://example.com/file.zip rg 'apiKey' -g '!*.min.js' -g '!package-lock.json' All CLI tips (46) All topics

Link