git commit -m 'submodule'提交到推送缓存, 这里create mode 160000 的意思是将tools/ShellTools作为一个目录记录提交上去,也就是一个空文件夹, clone本地仓库的后这个文件夹也是为空的,需要使用 submodule命令拉去代码。 git push 重新下载主仓,验证submodule可行性 新增一个目录 gitmodu
你必须运行两个命令:git submodule init用来初始化本地配置文件,而git submodule update则从该项目中抓取所有数据并检出父项目中列出的合适的提交。 $ git submodule init Submodule'DbConnector'(https://github.com/chaconinc/DbConnector) registered for path 'DbConnector'$ git submodule update Cloning into'DbC...
(use "git restore --staged <file>..." to unstage) new file: .gitmodules new file: learnsub 再次提交: $ git add ./ $ git commit -m "Add submodule" [master 2f86134] Add submodule 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 learnsub $ git p...
➜ henryyan@hy-hp ~ /submd/ws/project1 git:(master) ✗ git commit -a -m "add submodules[lib1,lib2] to project1" [master 7157977] add submodules[lib1,lib2] to project1 3 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 .gitmodules create mode 160000 libs ...
git 添加子模块配置 submodule 1. 在.git同级目录创建 .gitmodules文件夹2. 进入bash界面3. git submodule add <子模块git clone的地址> <映射到本地文件夹路径 A/B/C>以上配置完成使用git add/commit 提交即可4. git submodule init 初始化子仓库5. git submodule update --recursive 更新仓库内容 提交代码...
包括子模块的初始化,如何使用 git submodule add 命令在主仓库添加子模块 如何在子模块和主仓库之间的更新和同步 子模块主要有以下应用场景 不同项目间需要共享同一个公共代码,如基础类库或工具包; 较大的项目需要拆分成多个子项目进行开发,通过子模块控制依赖关系; ...
$ git commit -m"added new awesome textfile"[new_awesome 0567ce8] added new awesome textfile 1 file changed, 1 insertion(+) create mode 100644 new_awesome.txt $ git branch main * new_awesome Here we have changed directory to the awesomelibrary submodule. We have created a new text file...
Submodule DbConnector 0000000...c3f01dc (new submodule) When you commit, you see something like this: $ git commit -am 'added DbConnector module' [master fb9093c] added DbConnector module 2 files changed, 4 insertions(+) create mode 100644 .gitmodules ...
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|[--] <path>…)git submodule...
mkdir "$sm_path" || say "$(eval_gettext "Could not create empty submodule directory '\$displaypath'")" # Remove the .git/config entries (unless the user already did it) if test -n "$(git config --get-regexp submodule."$name\.")" then # Remove the whole section so we ...