Created
February 20, 2017 21:40
-
-
Save 7rin0/ffe348b99d0032e84b1a6a30275aa6d0 to your computer and use it in GitHub Desktop.
Bypass some limitations on getting origin HEAD by parsing each branch individually.
This file contains 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 | |
# Bypass some limitations on getting origin HEAD | |
# by parsing each branch individually. | |
# Get all origin branchs | |
ORIGINS=$(git ls-remote --heads origin | tr '\/' ' ' | tr -s ' ' | cut -d' ' -f3) | |
for branch in $ORIGINS | |
do | |
git fetch origin $branch -p | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment