2020-05-12 18:25:34 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-18 21:03:07 +02:00
|
|
|
# Very stupid script to create remote GitHub repo and replace
|
2020-05-12 18:25:34 +02:00
|
|
|
# https to ssh remote connection.
|
|
|
|
|
|
|
|
[ ! "$(git status 2>/dev/null)" ] && git init
|
|
|
|
|
2020-05-18 21:03:07 +02:00
|
|
|
gh repo create --public | sed 's/https:\/\//Added remote: git@/g'
|
2020-05-12 18:25:34 +02:00
|
|
|
|
|
|
|
url="$(git remote -v | awk 'NR==2 { print $2 }' | \
|
|
|
|
sed 's/.*https:\/\//git@/g; s/com\//com:/g')"
|
|
|
|
|
|
|
|
git remote remove origin
|
|
|
|
git remote add origin "$url"
|