Do you want to request a feature or report a bug? Bug What is the current behavior? Branch selection in Add Submodule form is not working properly. If the current behavior is a bug, please provide the steps to reproduce and if possible a...
当你遇到错误 git-submodule cannot be used without a working tree 时,这通常意味着你正在尝试在一个不包含工作目录(working tree)的Git仓库中执行子模块操作。以下是一些可能导致这个错误的原因以及如何解决它们: 1. 确认当前仓库是否为裸仓库(bare repository) 裸仓库是一个不包含工作目录的Git仓库,它通常用于远...
在project1中push之后其实就是更新了引用的commit id,然后project1-b在clone的时候获取到了submodule的commit id,然后当执行git submodule update的时候git就根据gitlink获取submodule的commit id,最后获取submodule的文件,所以clone之后不在任何分支上;但是master分支的commit id和HEAD保持一致。 查看~/submd/ws/project1...
我们在开发人员B的项目上修改Submodule的内容。 先看一下当前Submodule的状态: 1 2 3 4 ➜ henryyan@hy-hp ~/submd/ws/project1-bgit:(master)cdlibs/lib1 ➜ henryyan@hy-hp ~/submd/ws/project1-b/libs/lib1git status # Not currently on any branch. nothing to commit (working directory cl...
git rm asubmodule # Note: asubmodule (no trailing slash) # or, if you want to leave it in your working tree gitrm--cached asubmodulemvasubmodule_tmp asubmodule But you seem to still need a:rm-rf .git/modules/asubmodule 嗯!开始尝试 ...
包括子模块的初始化,如何使用 git submodule add 命令在主仓库添加子模块 如何在子模块和主仓库之间的更新和同步 子模块主要有以下应用场景 不同项目间需要共享同一个公共代码,如基础类库或工具包; 较大的项目需要拆分成多个子项目进行开发,通过子模块控制依赖关系; ...
提交submodule 获取submodule 更新submodule 增删submodule 参考:Git中submodule的使用 - 知乎 (zhihu.com) 使用场景 场景1:面对比较复杂的项目,我们有可能会将代码根据功能拆解成不同的子模块。主项目对子模块有依赖关系,却又并不关心子模块的内部开发流程细节。 场景2:当项目依赖并跟踪一个开源的第三方库时,将第三...
# On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: user_guide (new commits) 我們有了 new commit,有沒有發現與 git submodule add...
git config-f.gitmodules submodule.[submodule-name].branch[branch-name] 如果不用 -f .gitmodules 选项,那么它只会为你做修改。但是在仓库中保留跟踪信息更有意义一些,因为其他人也可以得到同样的效果。 https://blog.csdn.net/weixin_44070450/article/details/107701812 ...
2.1 创建Git Submodule测试项目 2.1.1 准备环境 1 2 3 henryyan@hy-hp ~pwd /home/henryyan mkdir-p submd/repos 创建需要的本地仓库: 1 2 3 4 5 cd~/submd/repos git--git-dir=lib1.gitinit--bare git--git-dir=lib2.gitinit--bare ...