aboutsummaryrefslogtreecommitdiffstats
path: root/gh-clone.sh
diff options
context:
space:
mode:
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}')