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 --- bash | 2 +- clone | 2 +- clone-all-github | 24 ++++++++++++++++++++++++ desc | 2 +- help | 2 +- init | 2 +- ls | 2 +- rm | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) create mode 100755 clone-all-github diff --git a/bash b/bash index 94d1f2f..c89fd51 100755 --- a/bash +++ b/bash @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash bash diff --git a/clone b/clone index f2bf406..673f0d7 100755 --- a/clone +++ b/clone @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ $# -ne 1 ]; then echo "usage: clone " 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 diff --git a/desc b/desc index 2d348ab..ed99ccc 100755 --- a/desc +++ b/desc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ $# -ne 1 ]; then echo "usage: desc " diff --git a/help b/help index f579f9b..3665137 100755 --- a/help +++ b/help @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash echo """Welcome to git-shell on $(uname -n)! diff --git a/init b/init index 08e7897..34e48a5 100755 --- a/init +++ b/init @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ $# -ne 1 ]; then echo "usage: init " diff --git a/ls b/ls index c7da128..cf37390 100755 --- a/ls +++ b/ls @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash find "$HOME" -maxdepth 1 -type d -name '*\.git' -printf "%f\n" diff --git a/rm b/rm index 1402bae..287f8ba 100755 --- a/rm +++ b/rm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ $# -ne 1 ]; then echo "usage: rm " -- cgit v1.2.3