Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save vagnerlandio/3289b51556a19f310d8df022765b0451 to your computer and use it in GitHub Desktop.

Select an option

Save vagnerlandio/3289b51556a19f310d8df022765b0451 to your computer and use it in GitHub Desktop.
Git checkout all remote branches
#!/bin/bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote" || true; done 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment