vxhskw
Last Updated: February 25, 2016
·
555
· diegoponciano
8845d5bf795057709b21c43d830f76e4

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
Say Thanks
Respond
Filed Under