Skip to content

Instantly share code, notes, and snippets.

@jellykells
Created May 6, 2019 07:18
Show Gist options
  • Save jellykells/6fc71e311471d5f4353770421041f6c2 to your computer and use it in GitHub Desktop.
Save jellykells/6fc71e311471d5f4353770421041f6c2 to your computer and use it in GitHub Desktop.
I was having an issue where Atom wouldn't list all the branches in a repository I cloned. This updates every local branch from it's remote tracking branch. Credit to Wookie88 on stackoverflow https://stackoverflow.com/a/10312587
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$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