Skip to content

Instantly share code, notes, and snippets.

@sysrex
Last active June 4, 2025 10:29
Show Gist options
  • Save sysrex/c1932d23b4e68116836b06aeb84a0e25 to your computer and use it in GitHub Desktop.
Save sysrex/c1932d23b4e68116836b06aeb84a0e25 to your computer and use it in GitHub Desktop.
My always used functions.zsh
function ghpr() {
if [ -z "$1" ]; then
echo "Usage: ghpr <pr-number>"
return 1
fi
local pr_number=$1
local branch_name="pr-${pr_number}"
# Fetch the PR from origin
git fetch origin pull/${pr_number}/head:${branch_name} && git checkout ${branch_name}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment