From 7f366104fbfeec61f07fe514701e81bd1d36a142 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Mon, 13 Jan 2025 11:21:58 -0500 Subject: [PATCH] gh: Alias co to use custom fetch-branch for pulling --- gh/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gh/config.yml b/gh/config.yml index 9a0e529..361fdef 100644 --- a/gh/config.yml +++ b/gh/config.yml @@ -9,6 +9,7 @@ prompt: enabled pager: # Aliases allow you to create nicknames for gh commands aliases: - co: pr checkout - prw: pr view -w + co: > + !(ref="$(gh pr view "$1" --json 'headRefName' --jq '.headRefName')" && git fetch-branch "$ref" && git switch "$ref") + prw: pr view -w version: "1"