$gitstatus On branch master No commits yet Changes to be committed:(use"git rm --cached <file>..."to unstage)new file: .gitmodules new file: reuse-code Commit and Push Submodule Next, you need to usegit commitan
从diff的结果分析出来时因为submodule的commit id更改了,我们前面刚刚讲了要在主项目更新submodule的内容首先要提交submdoule的内容,然后再更新主项目中引用的submodulecommit id;现在我们看到的不同就是因为刚刚更改了project1-b的submodule commit id;好的,我来学习一下怎么更新project1的公共类库。 follow me…… ➜...
好了,到目前为止我们已经使用git submodule add命令为project1成功添加了两个公共类库(lib1、lib2),查看了当前的状态发现添加了一个新文件(.gitmodules)和两个文件夹(libs/lib1、libs/lib2);那么新增的.gitmodules文件是做什么用的呢?我们查看一下文件内容便知晓了: 1 2 3 4 5 6 7 n@hy-hp ~/submd/w...
看到submodules的状态是hash码和文件目录,但是注意前面有一个减号:-,含义是该子模块还没有检出。 OK,检出project1-b的submodules…… 1 2 3 4 5 6 7 8 9 10 henryyan@hy-hp ~/submd/ws/project1-bgit:(master)gitsubmoduleinit Submodule'libs/lib1'(/home/henryyan/submd/repos/lib1.git) register...
follow me…… henryyan@hy-hp ~/submd/ws/project1 git:(master) git submodule update henryyan@hy-hp ~/submd/ws/project1 git:(master) git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what will be committed)# (use "git checkout -...
git submodule add [subrepo url] 运行git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: .gitmodules new file: subrepo 接着添加 submodule1,并指定路径 git submodule add [subrepo1 url] ./module/module1 ...
文艺程序员,使用Git Submodule功能,执行:git submodule update,然后冲一杯咖啡悠哉的享受着。 引用一段《Git权威指南》的话: 项目的版本库在某些情况虾需要引用其他版本库中的文件,例如公司积累了一套常用的函数库,被多个项目调用,显然这个函数库的代码不能直接放到某个项目的代码中,而是要独立为一个代码库,那么其...
Git Submodule 使用方法,本例采用两个项目以及两个公共类库演示对submodule的操作。因为在一写资料或者书上的例子都是一个项目对应1~N个lib,但是实际应用往往并不是这么简单。2.1创建GitSubmodule测试项目2.1.1...
而且我说 “难写”,也意味着 “易错”,意味着每个新的插件 (如 git submodule)或者二次开发的...
git submodule add [subrepo url] 运行git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: .gitmodules new file: subrepo 接着添加 submodule1,并指定路径 git submodule add [subrepo1 url] ./module/module1 ...