Created
December 20, 2019 12:42
-
-
Save SamuelMarks/f1c4d5d21a902fc396e7e834a467f07e to your computer and use it in GitHub Desktop.
Transfer all repos on GitHub.com (api.github.com) between organisations
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
#!/usr/bin/env bash | |
organisations="$(hub api '/user/orgs' | jq -r '.[] | .login')"; | |
repos="$(for org in $organisations; do hub api '/orgs/'"$org"'/repos' | jq -r '.[] | .name'; done)" | |
for org in $organisations; do | |
for repo in $repos; do | |
( hub api '/repos/'"$org"'/'"$repo"'/transfer' -F 'new_owner'='offscale' | jq . ) & | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment