Skip to content

Instantly share code, notes, and snippets.

@cedriclombardot
Created May 21, 2012 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedriclombardot/2761195 to your computer and use it in GitHub Desktop.
Save cedriclombardot/2761195 to your computer and use it in GitHub Desktop.
Copy all remotes git branch for origin and push to origin2
git branch -a | grep remotes/origin | grep -vw 'HEAD' | cut -d'/' -f3 | xargs -I {} sh -c 'git co {} && git push -u origin2 {}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment