Last active
December 31, 2016 04:02
-
-
Save darktef/5aa7a9261e15470eb0cf83693a06ee93 to your computer and use it in GitHub Desktop.
Fish - fetch all git branches
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
for remote in (git branch -r | grep -v HEAD) | |
// remove the origin/ | |
set bran (string replace -r 'origin\/' '' $remote) | |
// remove the left trailing white spaces | |
set br (string trim -l $bran) | |
set r (string trim -l $remote) | |
// create branch local to track the origin/branch | |
git branch --track $br $r | |
end | |
// to update all the branch | |
git fetch --all | |
// http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches | |
// it has to be some better way to do this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment