From 9f0226856e2047cd684457fa17b8d8a844671223 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Fri, 5 Sep 2025 16:48:21 +0200 Subject: [PATCH] zshrc: Add shortcut to checkout github PRs --- templates/_zshrc.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/_zshrc.j2 b/templates/_zshrc.j2 index 83cad88..d10f867 100644 --- a/templates/_zshrc.j2 +++ b/templates/_zshrc.j2 @@ -122,6 +122,18 @@ git_retag() { fi } +gh_checkout_pr() { + if [ "$#" -eq "2" ]; then + remote=$1 + pr=$2 + echo "trying to fetch PR #$pr from $remote..." + git fetch $remote pull/$pr/head:pr$pr + git checkout pr$pr + else + echo "ERROR: Please provide remote name and pr ID" + fi +} + # mpv alias mpv="mpv --autofit=70%"