aboutsummaryrefslogtreecommitdiffstats
path: root/gh-clone.sh
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-02-14 19:48:05 +0100
committerMatěj Cepl <mcepl@cepl.eu>2023-02-14 19:48:05 +0100
commit484d7e5251d25f50c1187365b9603be6be6054bb (patch)
tree345ff1ca218cf27d5a87ac5f7e0b6deaa33dc2b3 /gh-clone.sh
downloadhlupak-484d7e5251d25f50c1187365b9603be6be6054bb.tar.gz
Preserve shell history
Diffstat (limited to 'gh-clone.sh')
-rwxr-xr-xgh-clone.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/gh-clone.sh b/gh-clone.sh
new file mode 100755
index 0000000..2a2687e
--- /dev/null
+++ b/gh-clone.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+USERNAME=$(git config github.user)
+PASSWORD=$(pass show dev/github.com|awk '/^token:/ {print $2}')
+ORGANIZATION="openSUSE-Python"
+
+
+
+curl -s -u mcepl:$PASSWORD --json "{ \"organization\": \"$ORGANIZATION\" }" https://api.github.com/repos/JimmXinu/FanFicFare/forks |tee /tmp/curl-output.json
+git remote update
+git remote -v
+git remote add github (curl -s -u mcepl:(pass show dev/github.com|awk '/^token:/ {print $2}') https://api.github.com/repos/JimmXinu/FanFicFare/forks -d ''|awk -F '"' '/clone_url/ {print $4 ; exit}')
+git remote set-url --push github (curl -s -u mcepl:(pass show dev/github.com|awk '/^token:/ {print $2}') https://api.github.com/repos/JimmXinu/FanFicFare/forks -d ''|awk -F '"' '/ssh_url/ {print $4 ; exit}')