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 create can fill in the pull request from your commit messages

CLI
~/tips/tip-cli-gh-pr-create-fill

gh pr create --fill

Creates a pull request from the terminal, taking title and body from your commits.

Pushing a branch and then clicking through the web form to retype what is already in your commit message is busywork. gh can reuse the commit text.

On your feature branch, after committing:

gh pr create --fill

With --fill the title and body come from your commits, and the command offers to push the branch if it isn’t on the remote yet.

Two variants are worth knowing. --fill-first uses only the first commit, which is right when that one describes the change and the rest are fixups. --fill-verbose puts the full message and body of every commit in the description.

gh pr create --fill-first --draft --base main

I’d add --draft when CI should run before anyone gets a review request. If you pass --title or --body together with --fill, yours win over the generated text.

The result is only as good as your commit messages. A branch full of commits called wip gives a pull request called wip. Without --base it targets the branch set in the gh-merge-base git config, or else the repository’s default branch, so for release branches name the base explicitly.

Further reading: gh pr create (GitHub CLI manual)

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