From b1487df381e85ea7bdb4184ed076dc2136e9f99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 23 Feb 2025 18:12:14 +0100 Subject: [PATCH] [scripts/pull-request] handle branch already existing --- scripts/pull-request | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pull-request b/scripts/pull-request index dea9b292..c269116a 100755 --- a/scripts/pull-request +++ b/scripts/pull-request @@ -22,7 +22,8 @@ case "${2,,}" in ""|"f"|"fetch") call git remote add "$USER" git@github.com:"$USER"/"$REPO".git || true call git fetch "$USER" "$BRANCH" - call git checkout -b "$USER-$BRANCH" "$USER/$BRANCH" + call git branch "$USER-$BRANCH" "$USER/$BRANCH" || true + call git switch "$USER-$BRANCH" ;; "m"|"merge")