Forked from itsazzad/gh-org-clone-pull-create-add-push.sh
Created
July 16, 2024 11:54
-
-
Save pa-0/7489d850fa5e620db4a47b3aab8b57c3 to your computer and use it in GitHub Desktop.
Revisions
-
itsazzad renamed this gist
Aug 25, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
itsazzad renamed this gist
Aug 23, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
itsazzad renamed this gist
Aug 23, 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 @@ -27,6 +27,7 @@ echo "$repos" | while read -r repo; do gh repo clone "$repo_name" "$repo_name" -- -q 2>/dev/null || ( cd "$repo_name" git pull -q gh repo create $upstream/$f --public --confirm git remote add upstream [email protected]:$upstream/$repo_name.git git push upstream ) -
itsazzad renamed this gist
Aug 23, 2021 . 1 changed file with 5 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 @@ -1,16 +1,17 @@ #!/usr/bin/env bash # This script clones all repos in a GitHub org and pushes to the upstream # 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 USAGE="Usage: gh-clone-org <user|org> <target>" [[ $# -eq 0 ]] && echo >&2 "missing arguments: ${USAGE}" && exit 1 org=$1 upstream=$2 limit=9999 repos="$(gh repo list "$org" -L $limit)" @@ -26,8 +27,8 @@ echo "$repos" | while read -r repo; do gh repo clone "$repo_name" "$repo_name" -- -q 2>/dev/null || ( cd "$repo_name" git pull -q git remote add upstream [email protected]:$upstream/$repo_name.git git push upstream ) repos_complete=$((repos_complete + 1)) done -
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"