suivi d'une autre branche sur github
Question
J'essaie de suivre une branche différente d'un projet github. Le projet est reposful_authentication:
http://github.com/technoweenie/restful-authentication
Cependant, ce que je veux vraiment cloner, c’est la branche modulaire:
http://github.com/technoweenie/restful-authentication/tree/modular
J'ai trouvé ce guide:
http://github.com/guides/showing-and-tracking -remote-branches
et essayé quelques commandes comme:
git checkout --track -b lmod http://github.com/technoweenie/restful-authentication/tree/modular
et
git checkout --track -b lmod git://github.com/technoweenie/restful-authentication.git/modular
mais j'obtiens l'erreur suivante:
fatal: git checkout: updating paths is incompatible with switching branches
Avez-vous des idées sur la bonne façon de procéder?
Merci
La solution
Vous ne pouvez pas simplement cloner une branche, vous devez cloner le référentiel complet:
git clone git://github.com/technoweenie/restful-authentication.git
Vous pouvez ensuite utiliser une branche de suivi dans votre référentiel local:
cd restful-authentication
git checkout --track -b lmod origin/modular
Notez que, après le clonage, git a configuré un "quotient distant". avec le nom " origine " pour le référentiel distant et "origine / modulaire". identifie le " modulaire " branche de la "origine" à distance.