题
我正在尝试跟踪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分支
并尝试了一些命令,如:
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”的名称对于远程存储库和“origin / modular”,标识“模块化”标识。 “原点”的分支远程
不隶属于 StackOverflow