Created
February 17, 2012 03:19
-
-
Save mausch/1850280 to your computer and use it in GitHub Desktop.
Adds all github forks in the network for a particular repository
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
mainrepo="mausch/solrnet" | |
urls=$(curl -s "https://api.github.com/repos/$mainrepo/forks" | grep git_url | sed -re 's/.*: "(.*)",/\1/') | |
for url in $urls; do | |
remote=$(echo $url | cut -d/ -f4) | |
git remote add $remote $url | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's one that works for any Github repo. No need to hardcode the repo name, it gets it from .git/config. It also fetches more pages when there are more than 30 forks.