Skip to content

Instantly share code, notes, and snippets.

@dmezh
Last active September 18, 2022 16:27
Show Gist options
  • Save dmezh/41244492d8db7ede8ad9571f89ad12d7 to your computer and use it in GitHub Desktop.
Save dmezh/41244492d8db7ede8ad9571f89ad12d7 to your computer and use it in GitHub Desktop.
#!/bin/bash
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track ${branch#remotes/origin/} $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