Created
October 13, 2021 09:30
-
-
Save rkalit/11c4d4f9a1d22ea232e06c0594f7e5bd to your computer and use it in GitHub Desktop.
A script to get all remote branch to your local, put this script on your `/usr/local/bin`
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 | |
| workdir=$(pwd) | |
| tempFile=$HOME/temp.txt | |
| cd ${workdir} | |
| git branch -a | grep 'origin' | grep -v 'HEAD' | cut -d "/" -f3 -f4 > ${tempFile} | |
| for branch in `cat ${tempFile}`; | |
| do | |
| git checkout ${branch} | |
| git pull origin ${branch} | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment