Skip to content

Instantly share code, notes, and snippets.

@stockmind
Forked from piaoger/git-sync-all-branches.sh
Created October 15, 2019 14:02
Show Gist options
  • Save stockmind/a93b85551ee9353a7369731a8a73444d to your computer and use it in GitHub Desktop.
Save stockmind/a93b85551ee9353a7369731a8a73444d to your computer and use it in GitHub Desktop.
git-sync-all-branches
# fetch all branches
# From: http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
git fetch --all
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment