Created
March 26, 2024 04:39
-
-
Save blackstar257/83a43622042e5d12108fdfdb51433214 to your computer and use it in GitHub Desktop.
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 characters
gh repo list myorgname --limit 1000 | while read -r repo _; do | |
gh repo clone "$repo" "$repo" -- -q 2>/dev/null || ( | |
cd "$repo" | |
# Handle case where local checkout is on a non-main/master branch | |
# - ignore checkout errors because some repos may have zero commits, | |
# so no main or master | |
git checkout -q main 2>/dev/null || true | |
git checkout -q master 2>/dev/null || true | |
git pull -q | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment