Add very stupid 'ghrc' script
This commit is contained in:
parent
ee6f4a3458
commit
d554a370ee
14
.local/bin/scripts/ghrc
Executable file
14
.local/bin/scripts/ghrc
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Very stupid script to create remote GitHub repo and replace
|
||||
# https to ssh remote connection.
|
||||
|
||||
[ ! "$(git status 2>/dev/null)" ] && git init
|
||||
|
||||
gh repo create | sed 's/https:\/\//Added remote: git@/g'
|
||||
|
||||
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"
|
Loading…
x
Reference in New Issue
Block a user