在bashrc里加入如下代码 gitsubupdate function gitsubupdate(){ fn=`git commit | grep 'modified:' | sed -e 's/.*: *\(.*\) .* .*/\1/g'`for name in $fn do rm -rf $name rm -rf './git/submodule/'$name git submodule init git submodule update done } 之后source .ba...
1 modified content, untracked content (codes/) 说是codes文件夹虽然修改了,但是不能被跟踪,导致一直没办法更新。 修改步骤: 1:ll -a:进入codes文件夹下执行,查看codes文件夹下是否存在.git文件夹,一般情况下应该是存在,删除.git文件夹。网上说,是因为这个文件夹的存在,导致冲突所致。 2:git add codes: 重新...
由于status_submodule函数在执行"diff-files"的时候添加了 "--ignore-submodules=dirty"选项,忽略了所有工作目录的修改。 --ignore-submodules[=<when>] Ignore changes to submodules in the diff generation. <when> can be either "none", "untracked", "dirty" or "all", which is the default. Using ...
There is another way to do this which is a little simpler, however. If you pass--recurse-submodulesto thegit clonecommand, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themsel...
$ git submodule add /path/to/repos/libA.git lib/lib_a $ git submodule add /path/to/repos/libB.git lib/lib_b 至此看一下super版本库工作区的目录结构。在根目录下多了一个.gitmodules文件,并且两个函数库分别克隆到lib/lib_a目录和lib/lib_b目录下。
由于每个子模块都是自己的Git repo,因此可以单独重置每个子模块。 消除任何未提交的本地更改:进入每个子模块,运行git reset --hard 通过在顶层运行git submodule update...
we can update the parent repository again by doing agit addandgit commiton the submodule. This will put everything into a good state with the local content. If you are working in a team environment it is critical that you thengit pushthe submodule updates, and the parent repository updates...
可以看出,之前 “modified: projectB(modified content)” 已经不见了, 此时对修改后的.gitmodules文件进行commit和push, 之后在查看status或做commit时就可以忽略掉对子模块B修改的部分了。 到此这篇关于详解git submodule使用以及注意事项的文章就介绍到这了,更多相关git submodule使用内容请搜索脚本之家以前的文章或...
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 更新仓库内容 提交代码...
Shown when git-status[1] takes more than 2 seconds to enumerate untracked files, to tell the user that they can use the -u option. submoduleAlternateErrorStrategyDie Shown when a submodule.alternateErrorStrategy option configured to "die" causes a fatal error. submoduleMergeConflict Advice sho...