jueves, 18 de mayo de 2017

git clone all branches

git clone all branches

You can fetch one branch from all remotes like this:

git fetch --all
fetch updates local copies of remote branches so this is always safe for your local branches BUT:

fetch will not update local branches (which track remote branches); If you want to update your local branches you still need to pull every branch.
fetch will not create local branches (which track remote branches), you have to do this manually. If you want to list all remote branches: git branch -a
To update local branches which track remote branches:

git pull --all
However, this can be still insufficient. It will work only for your local branches which track remote branches. To track all remote branches execute this oneliner BEFORE git pull --all:

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done

No hay comentarios.:

Publicar un comentario