Skip to content

Instantly share code, notes, and snippets.

@avshatalov48
Created November 29, 2020 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avshatalov48/f9ba2cba93ec1c274ca7fa4627287c97 to your computer and use it in GitHub Desktop.
Save avshatalov48/f9ba2cba93ec1c274ca7fa4627287c97 to your computer and use it in GitHub Desktop.
Track all remote git branches as local branches
# Track all remote git branches as local branches
#
# !!! After git 1.9.1
#
# https://stackoverflow.com/a/379842
#
# Run:
# $ chmod 777 branches.sh
# $ ./branches.sh
#
for i in `git branch -a | grep remote | grep -v HEAD | grep -v master`; do git branch --track ${i#remotes/origin/} $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment