git submodule 的使用
- 进入主项目,git pull
- git submodule update
- 切换到submodule master分支,add, commit, push
- 进入主项目,提交主项目引用submodule的commit id
git add -u
git commit -m "update xxx to to lastest commit id"
git push
在主项目更新submodule的内容首先要提交submdoule的内容,然后再更新主项目中引用的submodulecommit id 总得来说,submodule 中修改了内容,并且做了commit,需要告诉主项目,我已经更新了,你也提交一下。
如果通过发PR的形式,合并之后会产生额外的commit_id,但是这个commit_id并没有“通知” 到主项目,这时需要自己在本地更新一下。