-
-
Save anilktechie/f27cfe2326ed1e9ba631fab4f17d2bcc to your computer and use it in GitHub Desktop.
Revisions
-
davegallant revised this gist
Jun 23, 2021 . 1 changed file with 7 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,10 +21,13 @@ repos_complete=0 echo echo "$repos" | while read -r repo; do repo_name="$(echo "$repo" | cut -f1)" echo -ne "\r\e[0K[ $repos_complete / $repo_total ] Cloning $repo_name" gh repo clone "$repo_name" "$repo_name" -- -q 2>/dev/null || ( cd "$repo_name" git pull -q ) repos_complete=$((repos_complete + 1)) done echo "Finished cloning all repos in $org." -
davegallant revised this gist
Jun 23, 2021 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ # This script clones all repos in a GitHub org # It requires the GH CLI: https://cli.github.com # It can be re-run to collect new repos and pull the latest changes set -euo pipefail @@ -10,7 +11,7 @@ USAGE="Usage: gh-clone-org <user|org>" [[ $# -eq 0 ]] && echo >&2 "missing arguments: ${USAGE}" && exit 1 org=$1 limit=9999 repos="$(gh repo list "$org" -L $limit)" @@ -22,8 +23,8 @@ echo echo "$repos" | while read -r repo; do repo_name="$(echo "$repo" | cut -f1)" echo -ne "\r\e[0K[ $repos_complete / $repo_total ] Cloning $repo_name" gh repo clone "$repo_name" "$repo_name" -- -q 2> /dev/null || (cd "$repo_name"; git pull -q) repos_complete=$((repos_complete + 1)) done echo "Finished cloning all repos in $org." -
davegallant renamed this gist
May 9, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
davegallant revised this gist
May 9, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env bash # This script clones all repos in a GitHub org # It requires the GH CLI: https://cli.github.com set -euo pipefail -
davegallant revised this gist
May 9, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #!/usr/bin/env bash # This script clones all repos in a GH org # It requires the GH CLI: https://cli.github.com set -euo pipefail -
davegallant created this gist
May 9, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/usr/bin/env bash # This script clones all repos in a GH org set -euo pipefail USAGE="Usage: gh-clone-org <user|org>" [[ $# -eq 0 ]] && echo >&2 "missing arguments: ${USAGE}" && exit 1 org=$1 limit=1000 repos="$(gh repo list "$org" -L $limit)" repo_total="$(echo "$repos" | wc -l)" repos_complete=0 echo echo "$repos" | while read -r repo; do repo_name="$(echo "$repo" | cut -f1)" echo -ne "\r\e[0K[ $repos_complete / $repo_total ] Cloning $repo_name" gh repo clone "$repo_name" "$repo_name" -- -q repos_complete=$((repos_complete + 1)) done echo "Cloning Complete"