How to git clone (track and fetch) all remote branches
This following script will loop for all remote branches, create one with the same name locally, track it to the remote, and then fetch/pull all of them.
#!/bin/bash
for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
git fetch --all
git pull --all
Written by Diego Ponciano
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#