From 7aef30d6001914b9c0b8ad65f0425585dd1433de Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 5 Oct 2026 18:15:31 +0200 Subject: [PATCH] fix: git remote switch script error --- scripts/git-switch-remote-type | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/git-switch-remote-type b/scripts/git-switch-remote-type index 468b11e..ae21ea4 100755 --- a/scripts/git-switch-remote-type +++ b/scripts/git-switch-remote-type @@ -4,18 +4,18 @@ set -e origin=$(git remote get-url origin) if [[ $(echo "$origin" | awk -e '/https/') != "" ]]; then - git_url="git@$(echo "$origin" | cut -d "/" -f 3):/$($(echo "$origin" | cut -d "/" -f 4-))" + git_url="git@$(echo "$origin" | cut -d "/" -f 3):/$(echo "$origin" | cut -d "/" -f 4-)" else git_url="https://$(echo "$origin" | cut -d "@" -f 2 | cut -d ":" -f 1)/$(echo "$origin" | cut -d ":" -f 2 | cut -d "/" -f 2-)" fi git_branches=$(git branch | grep '*' | tr -d ' *') git remote remove origin -git remote add origin $git_url +git remote add origin "$git_url" git fetch echo "New git url $git_url, updating branches" for branch in $git_branches; do - git checkout $branch - git branch --set-upstream-to=origin/$branch $branch + git checkout "$branch" + git branch --set-upstream-to=origin/$branch "$branch" echo "Branch $branch configured to track on origin/$branch" done