首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我切换git分支时,laradock子模块清空

当我切换git分支时,laradock子模块清空
EN

Stack Overflow用户
提问于 2017-01-30 23:45:44
回答 1查看 711关注 0票数 0

我正在做一个托管在github上的预先存在的Laravel项目,并且我已经使用laradock设置了我的开发环境。我使用git submodule add https://github.com/LaraDock/laradock.git在我的项目根目录上克隆了laradock存储库

然而,当我切换到一个不同的git分支时,laradock文件夹就被清空了。我再次运行git submodule add https://github.com/LaraDock/laradock.git并得到以下消息

代码语言:javascript
复制
A git directory for 'laradock' is found locally with remote(s):
  origin    https://github.com/LaraDock/laradock.git
If you want to reuse this local git directory instead of cloning again from
  https://github.com/LaraDock/laradock.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.

因此,我使用--force选项运行,它返回。但是我当然不应该在每次切换分支时都这样做?

EN

回答 1

Stack Overflow用户

发布于 2017-02-02 18:04:30

我删除了所有内容,然后重新开始。

我认为这个问题的发生可能是因为我在.gitignore中添加了laradock/和.gitmodules。

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

https://stackoverflow.com/questions/41939952

复制
相关文章

相似问题

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