zshrc: Add shortcut to checkout github PRs

This commit is contained in:
Jannik Beyerstedt 2025-09-05 16:48:21 +02:00
parent 53a716dd1d
commit 9f0226856e

View file

@ -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%"