Skip to content

Instantly share code, notes, and snippets.

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 celsobessa/6ed982a4a7ed0e712f39c94eb27e6c63 to your computer and use it in GitHub Desktop.
Save celsobessa/6ed982a4a7ed0e712f39c94eb27e6c63 to your computer and use it in GitHub Desktop.
Track, fetch and pull all remote branches on a remote GIT repository
# Track, fetch and pull all remote branches on a remote GIT repository
# Source: https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches/10312587#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