From f7f203fe9f2e03396824e30e8da30cbbe55b71d7 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Mon, 13 Oct 2025 21:47:32 -0400 Subject: add clone-all-github --- clone-all-github | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 clone-all-github (limited to 'clone-all-github') diff --git a/clone-all-github b/clone-all-github new file mode 100755 index 0000000..ebdeb78 --- /dev/null +++ b/clone-all-github @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +USER=compromyse +REPOS=$(curl https://api.github.com/users/$USER/repos 2>/dev/null | jq -r '.[0].name') + +for rawname in $REPOS; do + repo=$rawname.git + + if [ ! -d $HOME/$repo ]; then + + git clone --bare https://github.com/$USER/$repo $HOME/$repo + + pushd $HOME/$repo > /dev/null + + for remote in $(git remote show); do + git remote remove $remote + git remote add github git@github.com:$USER/$repo + git fetch github + done + + popd > /dev/null + + fi +done -- cgit v1.2.3