Adds grts

This commit is contained in:
Thomas Forgione 2020-03-09 11:45:13 +01:00
parent d4fc3fe41f
commit afe2f6ae3a
1 changed files with 10 additions and 0 deletions

10
bin/grts Executable file
View File

@ -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