git 子模块的使用

在使用thinkphp并利用git进行项目管理时,需要处理应用目录和核心框架的子模块。当删除子模块目录并在平台上创建私有项目后,添加子模块时遇到错误。解决方法包括执行特定git命令来初始化子模块,处理合并冲突。此外,安装框架时可以选择不使用子模块的方式。在遇到git冲突时,可以使用特定命令回退到冲突前状态并重新拉取代码。
摘要由CSDN通过智能技术生成

thinkphp 使用 git 方式安装下载的时候需要下载两个项目,
分别是 应用目录和核心框架。

开发完自己的需求的时候,
需要将代码上传到自己的git上面,
比如上传到 gitee 平台。

首先需要将应用目录下的 .git 目录删掉,
然后在 gitee 平台创建一个私有项目,
然后 remote add origin 私有项目的地址,
然后执行 git add .
会报错项目内有子模块。

$ git add .
warning: adding embedded git repository: thinkphp
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint:   git submodule add <url> thinkphp
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint:   git rm --cached thinkphp
hint:
hint: See "git help submodule" for more information.

这个时候执行命令

git
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值