diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2023-02-14 19:48:05 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2023-02-14 19:48:05 +0100 |
commit | 484d7e5251d25f50c1187365b9603be6be6054bb (patch) | |
tree | 345ff1ca218cf27d5a87ac5f7e0b6deaa33dc2b3 /gh-clone.sh | |
download | hlupak-484d7e5251d25f50c1187365b9603be6be6054bb.tar.gz |
Preserve shell history
Diffstat (limited to 'gh-clone.sh')
-rwxr-xr-x | gh-clone.sh | 12 |
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}') |