Created
April 11, 2019 14:04
-
-
Save Thesharing/bcb6265d1a08397123e1769e74e149d4 to your computer and use it in GitHub Desktop.
Clone and update all the forked repositories
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
| ORG=Awesome-Interview | |
| curl -s https://api.github.com/orgs/$ORG/repos?per_page=200 | jq .[].clone_url | xargs -n 1 git clone | |
| for REPO in * | |
| do | |
| cd $REPO | |
| curl -s https://api.github.com/repos/$ORG/$REPO | jq .parent.clone_url | xargs -n 1 git remote add upstream | |
| git fetch upstream | |
| git checkout master | |
| git merge upstream/master | |
| git push | |
| cd .. | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment