From d0523bc742f7f3ff048939644e5e173757d68143 Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 4 May 2020 10:01:54 +0800 Subject: update --- tools/swap-protocol.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/swap-protocol.bash b/tools/swap-protocol.bash index 00b6b4e..b7f4db2 100755 --- a/tools/swap-protocol.bash +++ b/tools/swap-protocol.bash @@ -13,9 +13,11 @@ git remote -v \ if [[ $url =~ git@.*github.com ]]; then target=${target:-https} + # git@ -> https:// [[ $target == https ]] && sed -E 's#^git@(.+):(.+)$#https://\1/\2#' <<<$url | xargs git remote set-url $extra $remote elif [[ $url =~ https://.*github.com ]]; then target=${target:-git} + # https:// -> git@ [[ $target == git ]] && sed -E 's#^https://([^/]+)/(.+)$#git@\1:\2#' <<<$url | xargs git remote set-url $extra $remote fi done -- cgit v1.2.3-70-g09d2