Skip to content

Instantly share code, notes, and snippets.

@gunnaraasen
Created September 4, 2014 15:46
Show Gist options
  • Select an option

  • Save gunnaraasen/6ee351d0bc51be222e0a to your computer and use it in GitHub Desktop.

Select an option

Save gunnaraasen/6ee351d0bc51be222e0a to your computer and use it in GitHub Desktop.
Download of an organization's repos and remote branches
# 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