-
-
Save fsimonis/5ccbfda8fdf9061e00c8268b617ec6cc to your computer and use it in GitHub Desktop.
Script using FZF and gh-cli to interactively checkout a PR. PR number and title are fuzzily searched using fzf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! bash | |
# Created by Frédéric Simonis | |
# May it bring you joy and preserve your sanity | |
if [ $# -eq 0 ]; then | |
gh pr list -L 999 --json number,title -t \ | |
'{{range .}}{{tablerow (printf "#%v" .number | autocolor "green") .title}}{{end}}' \ | |
| fzf --ansi \ | |
| sed "s/^#\([0-9]\+\).*/\1/" \ | |
| xargs gh pr checkout | |
else | |
gh pr checkout $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment