diff --git a/bin/grts b/bin/grts new file mode 100755 index 0000000..a330ec7 --- /dev/null +++ b/bin/grts @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Converts a http(s) remote to an ssh one +remote=$(git remote -v | grep origin | head -n 1 | cut -d $'\t' -f 2 | cut -d ' ' -f 1) +server=$(echo $remote | cut -d '/' -f 3) +user=$(echo $remote | cut -d '/' -f 4) +repo=$(echo $remote | cut -d '/' -f 5) +git remote set-url origin git@$server:$user/$repo + +