Skip to content

Instantly share code, notes, and snippets.

@CDRussell
Created December 22, 2021 13:09
Show Gist options
  • Save CDRussell/e9807ff049f02d95e76845f58c7a40aa to your computer and use it in GitHub Desktop.
Save CDRussell/e9807ff049f02d95e76845f58c7a40aa to your computer and use it in GitHub Desktop.

Alias to show open PRs, allow one to be selected, checked out and see PR status checks

Only PRs assigned to me

gh alias set co --shell 'id="$(gh pr list -L100 --assignee @me| fzf | cut -f1)"; [ -n "$id" ] && gh pr checkout "$id" && gh pr checks'

All PRs

gh alias set coall --shell 'id="$(gh pr list -L100 | fzf | cut -f1)"; [ -n "$id" ] && gh pr checkout "$id" && gh pr checks'

To run them

gh co     # see my PRs
gh coall  # see all PRs

Pre-requisites

  • Install GitHub CLI brew install gh
  • Install fzf brew install fzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment