首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >用git子模块替换了第三方代码,现在我不能切换分支

用git子模块替换了第三方代码,现在我不能切换分支
EN

Stack Overflow用户
提问于 2011-10-01 15:31:04
回答 2查看 2K关注 0票数 19

故事是这样的:我有两个git分支,masterdevelop,我目前在develop上。

我早就将第三方库的源文件包含在我的代码库中的Vendor/MGTwitterEngine目录中。此代码已合并到master中。

现在,在分支develop上,我已经删除了库,并将其替换为一个git子模块并提交。

问题是我不能再切换回master分支。如果我尝试,我会得到以下错误:

The following untracked working tree files would be overwritten by checkout:
    Vendor/MGTwitterEngine/MGTwitterHTTPURLConnection.h
    Vendor/MGTwitterEngine/MGTwitterHTTPURLConnection.m
    Vendor/MGTwitterEngine/MGTwitterLibXMLParser.h
    Vendor/MGTwitterEngine/MGTwitterLibXMLParser.m
    Vendor/MGTwitterEngine/MGTwitterMessagesLibXMLParser.h
    Vendor/MGTwitterEngine/MGTwitterMessagesLibXMLParser.m
    Vendor/MGTwitterEngine/MGTwitterMessagesParser.h
    Vendor/MGTwitterEngine/MGTwitterMessagesParser.m
    ...
   Aborting

git认为子模块文件是“未跟踪的”,不会在同一位置用跟踪的非子模块文件替换它们。

我该如何解决这个问题呢?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7618876

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档