zoukankan      html  css  js  c++  java
  • git submodule 删除及修改

    1.  删除子模块

    # 逆初始化模块,其中{MOD_NAME}为模块目录,执行后可发现模块目录被清空
    git submodule deinit {MOD_NAME} 
    # 删除.gitmodules中记录的模块信息(--cached选项清除.git/modules中的缓存)
    git rm --cached {MOD_NAME} 
    # 提交更改到代码库,可观察到'.gitmodules'内容发生变更
    git commit -am "Remove a submodule." 

    此外,你可能还需要删除 .git/modules/{MOD_NAME}的缓存,否则无法创建同名的module.

     2. 修改模块URL

    1. 修改'.gitmodules'文件中对应模块的”url“属性;
    2. 使用 git submodule sync 命令,将新的URL更新到文件.git/config
    thinker-g@localhost: ~/app$ git submodule sync 
    Synchronizing submodule url for 'gitmods/thinker_g/Helpers'
    thinker-g@localhost: ~/app$ # 运行后可观察到'.git/config'中对应模块的url属性被更新
    thinker-g@localhost: ~/app$ git commit -am "Update submodule url." # 提交变更

    PS: 本实验使用git 2.7.4 完成,较低版本git可能不能自动更新.git/config文件,需要修修改完".gitmodule"文件后手动修改.git/config.

    以上。

     

     

  • 相关阅读:
    eclipse 插件编写(三)(转)
    eclipse 插件编写(二)
    eclipse 插件编写(一)(转)
    js 中的 this 关键字
    js中创建对象的几种方式
    js 如何中如何理解对象?
    项目中的小技巧
    王国维的诗
    uni-app 基础组件
    登庐山 毛
  • 原文地址:https://www.cnblogs.com/qiyuexin/p/11266325.html
Copyright © 2011-2022 走看看