(1)进入主项目目录。 (2)使用命令 git submodule add <子项目地址> <子项目目录> 添加子模块。 (3)将子模块目录添加到 .gitignore 文件中,图片来源:https://m.nczpw.com.cn图片来源:https://www.wagou.com.cn图片来源:https://www.ni1688.cn图片来源:https://www.hdfsbw.cn图片来源:https://www.y...
git submodule add http://your-submodule-url.com/ local/path 这个命令可以将一个子模块添加到当前的主仓库中(注意,这样添加的是最新版的) 运行该命令的路径,为主仓库的根目录 这个git submodule有一些坑爹的地方 首先,在云端,git submodule所引用的模块,并非永远追踪最新的模块,而是追踪被引用模块的特定版本号的...
使用git submodule add命令会自动拉取子工程项目代码到指定目录,但其他开发者获取主项目代码时,使用git clone命令是不会拉取到子项目的代码的,必须运行两条命令: 代码语言:txt 复制 $ git submodule init # 初始化本地配置文件 $ git submodule update # 检出对应的 commit id 的子项目 也可以在 clone 命令中...
git submodule[--quiet] [--cached]git submodule[--quiet] add [<options>] [--] <repository> [<path>]git submodule[--quiet] status [--cached] [--recursive] [--] [<path>…]git submodule[--quiet] init [--] [<path>…]git submodule[--quiet] deinit [-f|--force] (--all...
git submodule add https://git.oschina.net/gaofeifps/leg.git 这时查看下状态会多两个文件 ➜ body git:(master) ✗ git status On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) ...
use the'--force'option. If the local git directoryisnot the correct repo or you are unsure whatthismeans choose another name with the'--name'option. git submodule add --name Common git@gitlab.abc.com:cs70/console-before.git console...
第一步:用Delete(keep local) 将目录或文件命令从git的索引库中移除子模块目录 第二步:删除物理文件 第三步:删除.gitmodule文件 第四步:删除.git/config的submodule配置源文件 第五步:删除后,提交更改 git的submodule功能详解 1.前言 项目的版本库在某些情况下需要引用其他版本库中的文件,例如有一套公用的代码库...
git submodule add https://github.com/my/repo.git folder 此时仓库里会有个.gitmodules文件,记录了子仓库信息。我们可以添加多个子仓库。 提交 对主仓库、子仓库都更新代码后,我们提交时,需要依次对两个仓库的 repo 进行提交。在主仓库里进行 git diff 会看到 ...
第一步:使用submodule add...添加子模组 在需要作添加子模组的Git版本库中右击,选择“TortoiseGit->Submodule Add...”,在“Repository:”里面输入需要添加子模组的版本库路径,在“Path:” 中输入添加子模组存放的目录路径。如下图所示: 此时查看需要添加子模组的Git工作区的目录结构。在根目录下多了一个.gitmodu...
[submodule "test"] url = http://github.com/wukongyun/test.git 3. 解析 git submodule 命令和用法 常用命令如下 git clone --recursive //递归的方式克隆整个项目, 包含子项目 git submodule add //添加子模块 git submodule init //初始化子模块 ...