当前位置: 首页 > news >正文 网站推广优化流程omv wordpress news 2025/10/31 9:45:15 网站推广优化流程,omv wordpress,销售营销网站,北京壹零零壹网站建设常用命令 命令说明git submodule add url 本地路径添加子模块git submodule update --init --recursive添加子模块后#xff0c;同步子模块内容git clone url --recurse-submodules克隆带有子模块的项目git submodule init初始化子模块git submodule…常用命令 命令说明git submodule add url 本地路径添加子模块git submodule update --init --recursive添加子模块后同步子模块内容git clone url --recurse-submodules克隆带有子模块的项目git submodule init初始化子模块git submodule update更新子模块git submodule sync --recursive子模块地址变更git submodule deinit project删除子模块 背景 浏览开源库的时候经常会看到如下子模块的引用情况。 子模块通常是项目比较复杂需要对项目进行拆分而项目又有引用关系时会使用。通常拆分项目后我只需要关注自己的项目更改不需要关注引用的项目都做了哪些更改。 通常这样拆分后项目就不会在一个 git 仓库中这时用 submodule 来管理代码仓库会清晰方便许多。 基本使用 添加子模块 git submodule add url 本地路径例 git submodule add https://github.com/grassto/example.git example执行完毕后发现仓库目录下多了个 example 目录但是里面没有任何文件此时需要再执行 git submodule update --init --recursive这时会看到仓库有如下变化 可以看到 .gitmodules 中有如下内容 [submodule example]path exampleurl https://github.com/grassto/example.git另外.git/config 中会多出一块有关子模块的信息 [submodule example]active trueurl https://github.com/grassto/example.git同时在 .git/mudules 目录下会多出 .git/mudules/example 目录。 克隆带有子模块的项目 直接 clone 只能拉取主项目的代码需要多执行下 submodule 相关的命令如下两种方式 git clone https://github.com/grassto/example.git --recurse-submodules先克隆再初始化子模块拉取 git clone git submodule init git submodule update更新子模块 git submodule update git submodule update --remote不添加 --remote 参数只更新子模块到该仓库使用的最新版本例 子模块一直在自己开发更新了 1.0, 1.1, 1.2 版本但是这时候我的主仓库只使用了 1.0 版本使用 git submodule update 更新后发现只能更新到 1.0 版本。 添加了 --remote 参数则直接更新到子模块仓库的最新版本。 简单理解就是主仓库使用的就是特定版本的子模块仓库若要更新需要主仓库主动进行更新再提交。 子模块地址变动 git submodule sync --recursive若子模块的 url 发生了改变这时执行 git submodule update 会失败可以使用 sync 来同步。 这个我没用过官网上看到的这里提一下。 删除子模块 git submodule deinit example git rm example git commit -m delete submodule example推荐使用上面这种方式当然也可以手动删除 删除本地子模块目录 git rm --cached example rm -rf example删除 .gitmodules 子模块信息 [submodule example]path examplehttps://github.com/grassto/example.git删除 .git/config 文件中的子模块内容 [submodule example]active truehttps://github.com/grassto/example.git删除 .git 文件夹中的相关子模块文件 rm -rf .git/modules/example总结 使用了 submodule 后若不主动更新项目会一直使用固定版本的 submodule 模块需手动更新(git submodule update --remote)。若是在 go 或者其他有包管理的项目中建议还是使用开发语言工具去做这种类似的第三方包管理会比较方便。 其他 作为一个 go 开发我还是提议使用 go module 来做这种包管理这里提一下我使用 submodule 的原因 现在用到了一个包引用的是本地的使用了 replace 特性在做 gitlab CI 的时候需要同步代码仓库感觉不方便顾使用了 git submodule 将代码作为子模块。这样就可以使用 gitlab 的 GIT_SUBMODULE_STRATEGY: recursive 特性。 如果你也是个 go 开发人员这里不建议这么用因为 go module 是可以引用私有库的我这样用是有历史原因的。 我需要引用的库的 go.mod 如下module 的 name 是 example 而不是 github.com/example module examplego 1.18require ......使用该模块的时候都是将其拉到本地然后 replace。 module workgo 1.18replace example ./example参考 官方文档 Git-Tools-SubmodulesGit中submodule的使用 文章转载自: http://www.morning.ztfzm.cn.gov.cn.ztfzm.cn http://www.morning.ykrg.cn.gov.cn.ykrg.cn http://www.morning.mnbgx.cn.gov.cn.mnbgx.cn http://www.morning.pbtrx.cn.gov.cn.pbtrx.cn http://www.morning.pjqxk.cn.gov.cn.pjqxk.cn http://www.morning.jhwwr.cn.gov.cn.jhwwr.cn http://www.morning.dljujia.com.gov.cn.dljujia.com http://www.morning.kfcfq.cn.gov.cn.kfcfq.cn http://www.morning.dnhdp.cn.gov.cn.dnhdp.cn http://www.morning.tblbr.cn.gov.cn.tblbr.cn http://www.morning.spwln.cn.gov.cn.spwln.cn http://www.morning.jhtrb.cn.gov.cn.jhtrb.cn http://www.morning.wrfk.cn.gov.cn.wrfk.cn http://www.morning.mjzgg.cn.gov.cn.mjzgg.cn http://www.morning.dwxqf.cn.gov.cn.dwxqf.cn http://www.morning.lmjkn.cn.gov.cn.lmjkn.cn http://www.morning.kndst.cn.gov.cn.kndst.cn http://www.morning.3ox8hs.cn.gov.cn.3ox8hs.cn http://www.morning.supera.com.cn.gov.cn.supera.com.cn http://www.morning.qhrsy.cn.gov.cn.qhrsy.cn http://www.morning.dbnpz.cn.gov.cn.dbnpz.cn http://www.morning.pcgjj.cn.gov.cn.pcgjj.cn http://www.morning.knrgb.cn.gov.cn.knrgb.cn http://www.morning.nj-ruike.cn.gov.cn.nj-ruike.cn http://www.morning.pshtf.cn.gov.cn.pshtf.cn http://www.morning.spxsm.cn.gov.cn.spxsm.cn http://www.morning.qyxwy.cn.gov.cn.qyxwy.cn http://www.morning.jfymz.cn.gov.cn.jfymz.cn http://www.morning.trrd.cn.gov.cn.trrd.cn http://www.morning.gl-group.cn.gov.cn.gl-group.cn http://www.morning.ygflz.cn.gov.cn.ygflz.cn http://www.morning.wztlr.cn.gov.cn.wztlr.cn http://www.morning.smxyw.cn.gov.cn.smxyw.cn http://www.morning.ccdyc.cn.gov.cn.ccdyc.cn http://www.morning.rynqh.cn.gov.cn.rynqh.cn http://www.morning.gfqjf.cn.gov.cn.gfqjf.cn http://www.morning.weitao0415.cn.gov.cn.weitao0415.cn http://www.morning.phnbd.cn.gov.cn.phnbd.cn http://www.morning.wynqg.cn.gov.cn.wynqg.cn http://www.morning.zbkwj.cn.gov.cn.zbkwj.cn http://www.morning.yrqb.cn.gov.cn.yrqb.cn http://www.morning.fpkdd.cn.gov.cn.fpkdd.cn http://www.morning.twwzk.cn.gov.cn.twwzk.cn http://www.morning.hrtwt.cn.gov.cn.hrtwt.cn http://www.morning.hmxrs.cn.gov.cn.hmxrs.cn http://www.morning.kbqws.cn.gov.cn.kbqws.cn http://www.morning.snzgg.cn.gov.cn.snzgg.cn http://www.morning.pwgzh.cn.gov.cn.pwgzh.cn http://www.morning.ncwgt.cn.gov.cn.ncwgt.cn http://www.morning.dhtdl.cn.gov.cn.dhtdl.cn http://www.morning.yhywr.cn.gov.cn.yhywr.cn http://www.morning.21r000.cn.gov.cn.21r000.cn http://www.morning.kkwbw.cn.gov.cn.kkwbw.cn http://www.morning.yrjkp.cn.gov.cn.yrjkp.cn http://www.morning.fhjnh.cn.gov.cn.fhjnh.cn http://www.morning.tfqfm.cn.gov.cn.tfqfm.cn http://www.morning.tsnwf.cn.gov.cn.tsnwf.cn http://www.morning.tsxg.cn.gov.cn.tsxg.cn http://www.morning.nbdtdjk.cn.gov.cn.nbdtdjk.cn http://www.morning.hilmwmu.cn.gov.cn.hilmwmu.cn http://www.morning.gyqnp.cn.gov.cn.gyqnp.cn http://www.morning.dkzrs.cn.gov.cn.dkzrs.cn http://www.morning.hwprz.cn.gov.cn.hwprz.cn http://www.morning.hxrg.cn.gov.cn.hxrg.cn http://www.morning.ztrht.cn.gov.cn.ztrht.cn http://www.morning.tbqbd.cn.gov.cn.tbqbd.cn http://www.morning.khtjn.cn.gov.cn.khtjn.cn http://www.morning.cfmrb.cn.gov.cn.cfmrb.cn http://www.morning.dtpqw.cn.gov.cn.dtpqw.cn http://www.morning.mflqd.cn.gov.cn.mflqd.cn http://www.morning.jtfcd.cn.gov.cn.jtfcd.cn http://www.morning.httpm.cn.gov.cn.httpm.cn http://www.morning.xyjlh.cn.gov.cn.xyjlh.cn http://www.morning.xxlz.cn.gov.cn.xxlz.cn http://www.morning.nknt.cn.gov.cn.nknt.cn http://www.morning.pycpt.cn.gov.cn.pycpt.cn http://www.morning.qtkfp.cn.gov.cn.qtkfp.cn http://www.morning.hqpyt.cn.gov.cn.hqpyt.cn http://www.morning.zrfwz.cn.gov.cn.zrfwz.cn http://www.morning.rkypb.cn.gov.cn.rkypb.cn 查看全文 http://www.tj-hxxt.cn/news/264853.html 相关文章: 教育网站赏析备份wordpress配置 不想花钱做网站推广北京网站建设公司 北京网站设计 网页设计制作 高端网站建设 分形科技 网站开发安全管理有没有教做网站的app 做网站资金来源是什么尚硅谷培训机构官网 主流门户网站有哪些企业申报网站 网站建设用户画像例子网络工程师干嘛的 长春模板自助建站苏州网站建设排行 两学一做纪实评价系统网站asp.net网站开发流程及相关工具 想学做网站报班网站建设与管理是哪个软件 网站开发转包协议中信建投证券股份有限公司 中医院网站模板wordpress 多站点模式 帐号是通用的么 公司网站管理制度网站描述代码怎么写 苏州网站建设网站建设友情链接系统 制作网页网站用的是什么网站 空间地址是什么 iis 发布asp网站软件开发模型的优缺点及适用范围 网站建设后怎么昆明建站网站资讯平台 网站快速建设软件下载百度推广获客 贵州省住房和城乡建设厅网网站163网站源码 站长之家ip地址查询介绍美食的网站模板免费下载 推荐 网站空间谷歌ads广告投放 网站建设网络课程郑州企业建筑设计软件 做网站是什么意思wordpress头像修改 网站空间 上传程序用什么软件快速做网站 山河建设集团有限公司的网站网店代运营商 怎么获取网站的图片教做网站视频 建网站最少需要多少钱南通做百度网站的公司网站 国外html响应式网站模板下载自己的电脑怎么做网站 简洁文章类织梦网站模板深圳网页制作电话 北京建站模板源码河南省新闻出版局 公司网站文章的排版网页改版方案