seguimiento de una rama diferente en github
Pregunta
Estoy tratando de rastrear una rama diferente de un proyecto github. El proyecto es restful_authentication:
http://github.com/technoweenie/restful-authentication
Sin embargo, lo que realmente quiero clonar es la rama modular:
http://github.com/technoweenie/restful-authentication/tree/modular
Encontré esta guía:
http://github.com/guides/showing-and-tracking -remote-ramas
y probé algunos comandos como:
git checkout --track -b lmod http://github.com/technoweenie/restful-authentication/tree/modular
y
git checkout --track -b lmod git://github.com/technoweenie/restful-authentication.git/modular
pero recibo el siguiente error:
fatal: git checkout: updating paths is incompatible with switching branches
¿Alguna idea sobre la forma correcta de hacer esto?
Gracias
Solución
No puede simplemente clonar una rama, debe clonar el repositorio completo:
git clone git://github.com/technoweenie/restful-authentication.git
Entonces puede usar una rama de seguimiento en su repositorio local:
cd restful-authentication
git checkout --track -b lmod origin/modular
Tenga en cuenta que, después de la clonación, git ha configurado un "control remoto" con el nombre "origen" para el repositorio remoto y "origen / modular" identifica el "modular" rama del " origen " remoto.