chore: improve git remote type switch
This commit is contained in:
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
|
||||
Reference in new issue
Block a user