Pergunta

Eu estou tentando rastrear um ramo diferente de um projeto github. O projeto é restful_authentication:

http://github.com/technoweenie/restful-authentication

No entanto, o que eu realmente quero clone é o ramo modular:

http://github.com/technoweenie/restful-authentication/tree/modular

Eu encontrei este guia:

http://github.com/guides/showing-and-tracking -remote-ramos

e tentou alguns comandos como:

git checkout --track -b lmod http://github.com/technoweenie/restful-authentication/tree/modular

e

git checkout --track -b lmod git://github.com/technoweenie/restful-authentication.git/modular

mas estou recebendo o seguinte erro:

fatal: git checkout: updating paths is incompatible with switching branches

Qualquer reflexão sobre a maneira correta de fazer isso?

Graças

Foi útil?

Solução

Você não pode simplesmente clonar um ramo, você tem que clonar o repositório completo:

git clone git://github.com/technoweenie/restful-authentication.git

Em seguida, você pode usar um ramo de rastreamento em seu repositório local:

cd restful-authentication
git checkout --track -b lmod origin/modular

Note-se que, após a clonagem, git criou um "controle remoto" com o nome de "origem" para o repositório remoto e "origem / modulares" identifica o ramo "modular" da "origem" remoto.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top