在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...
Add Git submodule Thegit submodule addis used to add a new submodule to an existing repository. The following is an example that creates an empty repo and explores Git submodules. $mkdirgit-submodule-demo $cdgit-submodule-demo/ $ git init Initialized empty Git repositoryin/Users/atlassian/git...
arguments limit which submodules will be initialized. It will also copy the value of submodule.$name.update into .git/config. The key used in .git/config is submodule.$name.url. This command does not alter existing information in .git/config. You can then customize the submodule clone URLs...
git submodule init// 初始化子模块git submodule update// 更新子模块与主仓库中的子模块代码同步// orgit submodule update--init// or 嵌套的(子仓库中包含子仓库)git submodule update--init--recursive 2. 在主仓库更改子仓库代码并提交方法: 3. 更新、拉取子仓库代码方法: 父目录中: 代码语言:javascript...
文艺程序员,使用Git Submodule功能,执行:git submodule update,然后冲一杯咖啡悠哉的享受着。 引用一段《Git权威指南》的话: 项目的版本库在某些情况虾需要引用其他版本库中的文件,例如公司积累了一套常用的函数库,被多个项目调用,显然这个函数库的代码不能直接放到某个项目的代码中,而是要独立为一个代码库,那么其...
2.1 创建Git Submodule测试项目 2.1.1 准备环境 ➜ henryyan@hy-hp ~ pwd /home/henryyan mkdir -p submd/repos 创建需要的本地仓库: cd ~/submd/repos git --git-dir=lib1.git init --bare git --git-dir=lib2.git init --bare git --git-dir=project1.git init --bare ...
If the location of the .git directory matches the pattern, the include condition is met. The .git location may be auto-discovered, or come from $GIT_DIR environment variable. If the repository is auto-discovered via a .git file (e.g. from submodules, or a linked worktree), the .git...
In the case where the path is a submodule, if the submodule commit used on one side of the merge is a descendant of the submodule commit used on the other side of the merge, Git attempts to fast-forward to the descendant. Otherwise, Git will treat this case as a conflict, suggesting ...
git-submodule.sh git-svn.perl git-web--browse.sh git-zlib.c git-zlib.h git.c git.rc.in gpg-interface.c gpg-interface.h graph.c graph.h grep.c grep.h hash-lookup.c hash-lookup.h hash.c hash.h hashmap.c hashmap.h help.c help.h hex-ll.c he...
If the option is # not in .gitmodules either, print a default value.# get_submodule_config () { name="$1" option="$2" default="$3" value=$(git config submodule."$name"."$option") if test -z "$value" then value=$(git config -f .gitmodules submodule."$name"....