Created
September 4, 2014 15:46
-
-
Save gunnaraasen/6ee351d0bc51be222e0a to your computer and use it in GitHub Desktop.
Download of an organization's repos and remote branches
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
| # Download all of an organization's repos | |
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' | |
| # Track all remote branches with a local branch, fetch them, and pull to update. | |
| for remote in `git branch -r`; do git branch --track $remote; done | |
| git fetch --all | |
| git pull --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment