Astuces Git
Cloner de github à travers un pare-feu
La façon standard:
git clone git@github.com:yogsototh/project.git
En utilisant le port HTTPS :
git clone git+ssh://git@github.com:443/yogsototh/project.git
Cloner toutes les branches
git clone peut seulement récuper la branche master.
Si vous n’avez pas beaucoup de branches, vous pouvez simplement les clone le project et ensuite pour chacune d’entre elle lancer la commande suivante :
git branch –track local_branch remote_branch
$ git clone git@github:yogsototh/example.git $ git branch master $ git branch -a master remotes/origin/HEAD -> origin/master remotes/origin/experimental $ git branch –track experimental remotes/origin/experimental $ git branch master * experimental
Si vous avez beaucoup de branches il peut être utile d’utiliser le script/la longue ligne de commande suivant(e) :
# first clone your project $ git clone git@github.com:yogsototh/project.git
copy all branches
$ zsh $ cd project $ for br in $( git br -a ); do case $br in remotes/) print $br ; case ${br:t} in master|HEAD) continue ;; ) git branch –track ${br:t} $br ;; esac ;; esac doneEt toutes les branches seront récupérées en local.
Published on 2010-03-22