我试图跟踪github项目的不同分支.该项目是restful_authentication:
http://github.com/technoweenie/restful-authentication
但是,我真正想要克隆的是模块化分支:
http://github.com/technoweenie/restful-authentication/tree/modular
我找到了这个指南:
http://github.com/guides/showing-and-tracking-remote-branches
并尝试了一些命令,如:
git checkout --track -b lmod http://github.com/technoweenie/restful-authentication/tree/modular
和
git checkout --track -b lmod git://github.com/technoweenie/restful-authentication.git/modular
但我收到以下错误:
fatal: git checkout: updating paths is incompatible with switching branches
有关正确方法的任何想法吗?
谢谢
你不能只是克隆一个分支,你必须克隆完整的存储库:
git clone git://github.com/technoweenie/restful-authentication.git
然后,您可以在本地存储库中使用跟踪分支:
cd restful-authentication git checkout --track -b lmod origin/modular
请注意,在克隆之后,git为远程存储库设置了名为"origin"的"remote","origin/modular"标识了"origin"远程的"modular"分支.