Last active
November 25, 2024 03:35
-
-
Save sasasin/28c1925a1643736ccde6dbfd44999b25 to your computer and use it in GitHub Desktop.
GitHub Organization に存在する全 GitHub repo を git clone するやつ
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
#!/bin/bash | |
# GitHub Organization に存在する全 GitHub repo を git clone するやつ | |
# 自分が Read 以上のアクセス権を持っている GitHub repo に限られる | |
# 組織名を指定する | |
GH_ORG=$1 | |
# ページングしてくれないので欲しいだけ全部が収まる数を指定する | |
GH_LIMIT=$2 | |
# 並列数 | |
XARGS_P=$3 | |
gh repo list "${GH_ORG}" --no-archived --limit ${GH_LIMIT} \ | |
| cut -f 1 \ | |
| sort \ | |
| awk '{print "[email protected]:" $1 ".git"}' \ | |
| xargs -L1 -P${XARGS_P} ghq get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment