scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

git-pull-all.sh (466B)


      1 #!/usr/bin/env bash
      2 # src: https://gist.github.com/grimzy/a1d3aae40412634df29cf86bb74a6f72
      3 # description: pull all remote branches to the local repo
      4 
      5 
      6 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
      7 	echo "Usage: git-pull-all"
      8 	echo ""
      9 	echo "pull all remote branches of repo in callers working directory to local"
     10 	exit
     11 fi
     12 
     13 git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
     14 git fetch --all
     15 git pull --all
     16