Skip to content

Instantly share code, notes, and snippets.

@sytabaresa
Last active November 2, 2018 15:32
Show Gist options
  • Save sytabaresa/661c501f1e2a941cecdbcce517fd6b4b to your computer and use it in GitHub Desktop.
Save sytabaresa/661c501f1e2a941cecdbcce517fd6b4b to your computer and use it in GitHub Desktop.
descarga todas las ramas de un repo y actualiza las referencias a las ramas remotas (primero moverse a la carpeta del repo)
#!/bin/bash
# Moverse a la carpeta del repo primero
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|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