Last active
August 29, 2015 14:08
-
-
Save dineshkp-dev/0bef31a0b6a1fb3e68da to your computer and use it in GitHub Desktop.
Shell script to create and track all the remote branches for a Repository's clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for eachbranch in $(git branch -a | grep remotes | grep -v HEAD | grep -v master | awk -F/ '{print $3}'); | |
do | |
git branch $eachbranch --track remotes/origin/$eachbranch; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment