[英]Git Submodule Hell on Add: "fatal: remote <url> already exists
我有一个包含几个(10+)子模块的项目。 然后,我在与其他所有子模块的家相同的位置创建了另一个[裸]存储库,并使用git submodule add
其添加到我的项目中。
不幸的是,当我签出master时,它从目录中添加了一个文件,而不是将其识别为子模块。
对于此示例,我们假设它将被安装/放置在components/NewComponent
并且其URL为customURL://components/NewComponent.git
(注意: customURL://
已在〜/ .gitconfig中正确配置,并已由其他10多个子模块完美) 。
我已经完成了git rm components/NewComponent ; git commit -m "Removed the offending directory"
git rm components/NewComponent ; git commit -m "Removed the offending directory"
但是,当我打电话时:
git remote add customURL://components/NewComponent.git components/NewComponent
我收到此错误:
fatal: remote customURL://components/NewComponent.git already exists.
但是它不在components目录中,也不在.gitmodules
文件中。
如果我手动将其放入文件中,则无论执行deinit
, init
, update
, sync
还是完全克隆存储库并重新init
和update
它都无所谓。 git submodule status
不会以任何状态显示它(尽管它显示了其他所有内容!)。 它完全忽略了它的存在。
任何帮助将不胜感激!
笔记:
git version 1.8.3.4 (Apple Git-47)
更新:
这是一个PEBKAC问题。...我应该已经编写了git submodule add
。
检查git remote
的手册页。 遥控器的名称应在旁边add
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.