Last active
July 5, 2022 02:23
-
-
Save pataiji/6d4bc66651c96eeccd1e47cbe4b5f3eb to your computer and use it in GitHub Desktop.
Clone multiple repositories
This file contains 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
#!/bin/bash | |
repos=$(gh repo list hoge_org \ | |
--no-archived \ | |
--limit 1000 \ | |
--json name \ | |
--jq '.[].name') | |
for repo in $repos; | |
do | |
if [[ ! -d $repo ]]; then | |
git clone [email protected]:hoge_org/$repo | |
fi | |
done |
This file contains 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 hoge_org \ | |
--no-archived \ | |
--limit 1000 \ | |
--json sshUrl \ | |
--jq '.[].sshUrl | select(contains("hoge_org/fuga"))' \ | |
| xargs -I{} git clone {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment