chore: improve git remote type switch

This commit is contained in:
janishutz committed 2026-10-04 16:37:48 +02:00
1 parent 4d15735df4
commit e42026d51c
1 file changed
+1 -1
@@ -4,7 +4,7 @@ origin=$(git remote show origin)
if [[ $(echo "$origin" | awk -e '/https/') != "" ]]; then
remote=$(git remote show origin | awk -e '/Fetch/' | cut -d ":" -f 3)
git_host=$(echo "$remote" | cut -d "/" -f 3)
git_repo=$(echo "$remote" | cut -d "/" -f 4-5)
git_repo=$(echo "$remote" | cut -d "/" -f 4-)
git_branch=$(echo "$origin" | awk -e '/HEAD/' | cut -d ":" -f 2 | tr -d ' ')
git remote remove origin
git remote add origin git@$git_host:/$git_repo